odapi/tests/requests_test.py

24 lines
674 B
Python
Raw Normal View History

2020-05-03 00:45:45 +02:00
from app.models import *
from config import Config
from pytest import fixture
from secrets import token_hex
from werkzeug.security import generate_password_hash
def test_registration(client):
user = {
"full_name": "Bilal Balaperdida",
"email": "oyvey@hotmail.com",
"password": generate_password_hash(password="lifeisabitch", method="md5"),
"gender": 3,
"mobile": "+212655778899",
"city_id": 12,
"user_type": 1,
"lang_type": 1,
"device_id": token_hex(8),
"device_type": 1,
"badge": 0,
}
response = client.post("/register", json=user)
assert response.status == "200 OK"