-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconftest.py
55 lines (48 loc) · 1.35 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import pytest
from mongoengine import connect, disconnect
from starlette.testclient import TestClient
from api.main import app
@pytest.fixture
def client():
return TestClient(app)
@pytest.fixture
def mongo(scope='function'):
disconnect('default')
db = connect('test_db', host='mongodb://localhost')
yield db
db.drop_database('test_db')
disconnect('default')
@pytest.fixture
def users_data():
return [
{
'name': 'Jorge Plautz',
'password': '1234567890',
'email': '[email protected]',
'user_todo': [
{
'id': '6158675285c8a31729632ab1',
'name': 'Estudar fastAPI'
},
{
'id': '6158675285c8a31729632ab2',
'name': 'Estudar MongoDB'
},
]
},
{
'name': 'Vicente Marçal',
'password': '0987654321',
'email': '[email protected]',
'user_todo': [
{
'id': '6158675285c8a31729632bc1',
'name': 'Estudar fastAPI com Pydantic'
},
{
'id': '6158675285c8a31729632bc2',
'name': 'Estudar MongoDB com MongoEngine'
},
]
},
]