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