summaryrefslogtreecommitdiffstats
path: root/python/tests/fixtures.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-04-04 18:18:21 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-04-04 18:18:23 -0700
commit5b4af5300ec58867d96affeb62e66032149cc0e7 (patch)
tree9e3feee4d615327ef1a782afff8dd163b1087477 /python/tests/fixtures.py
parent0240f792951444d6459e7621f43f0fc892599402 (diff)
downloadfatcat-5b4af5300ec58867d96affeb62e66032149cc0e7.tar.gz
fatcat-5b4af5300ec58867d96affeb62e66032149cc0e7.zip
test api helpers (found bug)
It seems that public_api() doesn't get isolated from authenticated_api(), even in different tests. I suspect this is due to using DefaultAPI to create client.
Diffstat (limited to 'python/tests/fixtures.py')
-rw-r--r--python/tests/fixtures.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/python/tests/fixtures.py b/python/tests/fixtures.py
index 41673d8a..478fdd79 100644
--- a/python/tests/fixtures.py
+++ b/python/tests/fixtures.py
@@ -8,6 +8,7 @@ from dotenv import load_dotenv
import fatcat_web
import fatcat_client
+from fatcat_tools import authenticated_api
@pytest.fixture
def full_app():
@@ -33,11 +34,7 @@ def app_admin(app):
@pytest.fixture
def api():
load_dotenv(dotenv_path="./example.env")
- conf = fatcat_client.Configuration()
- conf.host = "http://localhost:9411/v0"
- conf.api_key["Authorization"] = os.getenv("FATCAT_API_AUTH_TOKEN")
- conf.api_key_prefix["Authorization"] = "Bearer"
- api_client = fatcat_client.DefaultApi(fatcat_client.ApiClient(conf))
+ api_client = authenticated_api("http://localhost:9411/v0")
api_client.editor_id = "aaaaaaaaaaaabkvkaaaaaaaaae"
return api_client