Ejemplo n.º 1
0
    def authenticate(self, **credentials):
        UserModel = get_user_model()
        username = credentials.get(UserModel.USERNAME_FIELD, None)
        username = username or credentials.get('username')
        self.login_logger.log_failed_login(username, get_request())

        return None
 def test_request_is_saved(self):
     response = self.client.get('', X_TEST='middleware test')
     request = get_request()
     self.assertTrue(request is not None)
     self.assertEquals(request.META['X_TEST'], 'middleware test')