-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconftest.py
More file actions
64 lines (39 loc) · 1.17 KB
/
conftest.py
File metadata and controls
64 lines (39 loc) · 1.17 KB
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
56
57
58
59
60
61
62
63
64
import os
import pytest
from wepost.apps.auth.models import WepostUser
from wepost.apps.posts.models import Node
### 用户 pytest fixtures
@pytest.fixture()
def ut1(db):
return WepostUser.objects.filter(username="test1").first()
@pytest.fixture()
def ut2(db):
return WepostUser.objects.filter(username="test2").first()
@pytest.fixture()
def ut3(db):
return WepostUser.objects.filter(username="test3").first()
@pytest.fixture()
def ut4(db):
return WepostUser.objects.filter(username="test4").first()
@pytest.fixture()
def ut5(db):
return WepostUser.objects.filter(username="test5").first()
@pytest.fixture()
def ut6(db):
return WepostUser.objects.filter(username="test6").first()
### 节点 pytest fixtures
@pytest.fixture()
def node_py():
return Node.objects.filter(code="python").first()
@pytest.fixture()
def node_flask():
return Node.objects.filter(code="flask").first()
@pytest.fixture()
def node_js():
return Node.objects.filter(code="javascript").first()
@pytest.fixture()
def node_vue(db):
return Node.objects.filter(code="vue").first()
@pytest.fixture()
def node_c(db):
return Node.objects.filter(code="c").first()