class TestBackendUtils(unittest.TestCase): def setUp(self): self.user = get_user_model().objects.create(username='******') self.inactive_user = get_user_model().objects.create(username='******', is_active=False) self.backend = NoPasswordBackend() def tearDown(self): self.user.delete() self.inactive_user.delete() def test_verify_user(self): self.assertTrue(self.backend.verify_user(self.user)) self.assertFalse(self.backend.verify_user(self.inactive_user)) def test_send_login_code(self): self.assertRaises(NotImplementedError, self.backend.send_login_code, code=None)
class TestBackendUtils(TestCase): def setUp(self): self.user = get_user_model().objects.create(username='******') self.inactive_user = get_user_model().objects.create(username='******', is_active=False) self.backend = NoPasswordBackend() def tearDown(self): self.user.delete() self.inactive_user.delete() def test_verify_user(self): self.assertTrue(self.backend.verify_user(self.user)) self.assertFalse(self.backend.verify_user(self.inactive_user)) def test_send_login_code(self): self.assertRaises(NotImplementedError, self.backend.send_login_code, code=None, secure=False)
def setUp(self): self.user = get_user_model().objects.create(username='******') self.inactive_user = get_user_model().objects.create(username='******', is_active=False) self.backend = NoPasswordBackend()
def test_send_login_code(self): backend = NoPasswordBackend() self.assertRaises(NotImplementedError, backend.send_login_code, code=None, context=None)