def testBackendGetUserAnnotates(self): # Check that the lazysignup backend annotates the user object # with the backend, mirroring what Django's does lazy_view(self.request) backend = LazySignupBackend() pk = User.objects.all()[0].pk self.assertEqual('lazysignup.backends.LazySignupBackend', backend.get_user(pk).backend)
def test_backend_get_custom_user_class(self): # The get_user method on the backend should also return instances of # the custom user class. lazy_view(self.request) backend = LazySignupBackend() user_class = LazyUser.get_user_class() pk = user_class.model.objects.all()[0].pk self.assertEqual(user_class, type(backend.get_user(pk)))
def test_backend_get_user_annotates(self): # Check that the lazysignup backend annotates the user object # with the backend, mirroring what Django's does lazy_view(self.request) backend = LazySignupBackend() pk = get_user_model().objects.all()[0].pk self.assertEqual( "lazysignup.backends.LazySignupBackend", backend.get_user(pk).backend )
def setUp(self): self.backend = LazySignupBackend()