def test_authenticate_username_not_active(self):
    'Test to authenticate an inactive user.'
    self.user.is_active = False
    self.user.save()
    backend = DakaraModelBackend()
    self.assertIsNone(backend.authenticate(MagicMock(), username='TestUser', password='pass'))
Test to authenticate an inactive user.
def test_authenticate_username_not_active(self):
    
    self.user.is_active = False
    self.user.save()
    backend = DakaraModelBackend()
    self.assertIsNone(backend.authenticate(MagicMock(), username='TestUser', password='pass'))