Fix tests
This commit is contained in:
parent
433c2c3de3
commit
e91574fe3c
|
@ -4,7 +4,7 @@ FROM ${BASE_IMAGE}
|
|||
|
||||
ENV FLASK_DEBUG=1
|
||||
ENV FLASK_ENV=development
|
||||
ENV DATABASE_TEST_URL=postgresql://postgres:postgres@usermanager-db:5432/api_test
|
||||
ENV DATABASE_TEST_URL=postgresql://user:password@usermanager-db:5432/api_test
|
||||
|
||||
# add and install requirements
|
||||
COPY --chown=python:python ./requirements.test.txt .
|
||||
|
|
|
@ -54,8 +54,8 @@ class Login(Resource):
|
|||
access_token = user.encode_token(user.id, "access", user.airline)
|
||||
refresh_token = user.encode_token(user.id, "refresh")
|
||||
|
||||
response_object = {"access_token": access_token,
|
||||
"refresh_token": refresh_token,
|
||||
response_object = {"access_token": access_token,
|
||||
"refresh_token": refresh_token,
|
||||
"user_id": user.id}
|
||||
return response_object, 200
|
||||
|
||||
|
|
|
@ -89,8 +89,9 @@ class User(db.Model):
|
|||
def get_api_auth_full_user_model(cls, namespace):
|
||||
return namespace.clone(
|
||||
"User Full",
|
||||
cls.get_api_auth_user_model(namespace),
|
||||
{
|
||||
"username": fields.String(required=True),
|
||||
"email": fields.String(required=True),
|
||||
"password": fields.String(required=True),
|
||||
},
|
||||
)
|
||||
|
|
|
@ -22,6 +22,8 @@ def test_user_registration(test_app, test_database):
|
|||
content_type="application/json",
|
||||
)
|
||||
data = json.loads(resp.data.decode())
|
||||
print(data)
|
||||
print(resp)
|
||||
assert resp.status_code == 201
|
||||
assert resp.content_type == "application/json"
|
||||
assert TEST_USERNAME in data["username"]
|
||||
|
|
Loading…
Reference in New Issue