def validate(self, data): print(data['user']) email = data['user'].email password = data.get('password') if email and password: user = BaseAuthentication.authenticate(email=email, password=password) if user: msg = _("User account is disabled.") raise ValidationError(msg) else: msg = _("Must include email and password.") raise ValidationError(msg) data['user'] = user return data
def test_base_authentication_abstract_method(self): with pytest.raises(NotImplementedError): BaseAuthentication().authenticate({})