def test_authenticate_username_ok(self):
    'Test to authenticate.'
    self.user.validated_by_email = True
    self.user.validated_by_manager = True
    self.user.save()
    backend = DakaraModelBackend()
    self.assertEqual(backend.authenticate(MagicMock(), username='TestUser', password='pass'), self.user)
Test to authenticate.
def test_authenticate_username_ok(self):
    
    self.user.validated_by_email = True
    self.user.validated_by_manager = True
    self.user.save()
    backend = DakaraModelBackend()
    self.assertEqual(backend.authenticate(MagicMock(), username='TestUser', password='pass'), self.user)