diff --git a/setup.py b/setup.py index 1f5d768..d32ba68 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,7 @@ "test": [ "aiosqlite", "black", + "httpx", "isort", "pytest-asyncio", "pytest-factoryboy", diff --git a/tests/client.py b/tests/client.py index 2a2d9ab..941a2be 100644 --- a/tests/client.py +++ b/tests/client.py @@ -10,7 +10,7 @@ def url_for(self, name, host=socket.gethostname()): def get(self, endpoint): url = self.url_for(endpoint) - return super().get(url, cookies=self.cookies) + return super().get(url) def post(self, endpoint, data=None): url = self.url_for(endpoint) @@ -18,24 +18,23 @@ def post(self, endpoint, data=None): url, json=data, headers=self.headers, - cookies=self.cookies, ) return response def put(self, endpoint, data=None): url = self.url_for(endpoint) - response = super().put(url, json=data, cookies=self.cookies) + response = super().put(url, json=data) return response def patch(self, endpoint, data=None): url = self.url_for(endpoint) - response = super().patch(url, json=data, cookies=self.cookies) + response = super().patch(url, json=data) return response def delete(self, endpoint): url = self.url_for(endpoint) - return super().delete(url, cookies=self.cookies) + return super().delete(url) def login(self, user, endpoint="/auth/login"): data = { @@ -43,5 +42,5 @@ def login(self, user, endpoint="/auth/login"): "password": "Sekrit", } response = self.post(endpoint, data) - setattr(self, "cookies", response.cookies) + self.cookies = response.cookies return response