def test_swap_customer_on_login(self):
        request = self.factory.post('/shop/auth/login/', follow=True)
        request.user = self.bart
        old_customer = Customer()
        old_customer.save()
        request.session = {
            'session_key': 'bart_swap',
            SESSION_KEY: old_customer.pk,
        }
        request.customer = self.bart.customer
        user_logged_in.send(sender=self.bart.__class__, request=request, user=self.bart)
        try:
            Customer.objects.get_customer(request, force_unauth=True)
        except Customer.DoesNotExist:
            pass
        else:
            self.fail("""Unauthenticated customer should be deleted on login
                by a User with existing Customer""")
        self.assertEqual(request.customer, self.bart.customer)
    
    # login tests have to be massively refactored, false negatives and positives
    # encountered
Updates the Rietveld metadata associated with the current branch.
dataset/ETHPy150Open awesto/django-shop/testshop/skip_test_customer.py/CustomerTest.test_swap_customer_on_login--crossover with--dataset/ETHPy150Open googlearchive/git-rv/export.py/ExportAction.update_metadata