@config_email_disabled
def test_authenticate_username_not_validated_by_email_no_email(self):
    'Test to authenticate when not validated by email and emails disabled.'
    self.user.validated_by_email = False
    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 when not validated by email and emails disabled.
@config_email_disabled
def test_authenticate_username_not_validated_by_email_no_email(self):
    
    self.user.validated_by_email = False
    self.user.validated_by_manager = True
    self.user.save()
    backend = DakaraModelBackend()
    self.assertEqual(backend.authenticate(MagicMock(), username='TestUser', password='pass'), self.user)