From f470f8bff77795283b8ca0ea8eebc911c980a6b5 Mon Sep 17 00:00:00 2001 From: coolneng Date: Fri, 11 Sep 2020 00:07:45 +0200 Subject: [PATCH] Implement user registration --- tests/queries_test.py | 3 ++- tests/requests_test.py | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/tests/queries_test.py b/tests/queries_test.py index 93b5ddb..3921a45 100644 --- a/tests/queries_test.py +++ b/tests/queries_test.py @@ -1,8 +1,9 @@ from datetime import datetime +from pytest import fixture + from database.models import * from tests import TestingSessionLocal -from pytest import fixture @fixture diff --git a/tests/requests_test.py b/tests/requests_test.py index db28002..af63147 100644 --- a/tests/requests_test.py +++ b/tests/requests_test.py @@ -1,27 +1,31 @@ -from database.models import * -from pytest import fixture +from pytest import mark from secrets import token_hex +from app.schemas import * +from tests import client -def test_registration(client): + +def test_registration(): user = { "full_name": "Bilal Balaperdida", "email": "oyvey@hotmail.com", "password": "lifeisabitch", - "gender": 3, + "gender": 1, "mobile": "+212655778899", - "city_id": 12, "user_type": 1, "lang_type": 1, - "device_id": token_hex(16), "device_type": 1, - "badge": 0, + "device_id": token_hex(16), + "city_id": 5, + "access_key": token_hex(16), + "badge": 1, } response = client.post("/register", json=user) - assert response.status == "200 OK" + assert response.status_code == 200 -def test_login(client): +@mark.skip(reason="not implemented") +def test_login(): user = { "email": "12@gmail.com", "password": "odyfo2020", @@ -30,4 +34,4 @@ def test_login(client): "user_type": 1, } response = client.post("/login", json=user) - assert response.status == "200 OK" + assert response.status_code == 200