forked from pythonprobr/pythonpro-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
57 lines (38 loc) · 1.16 KB
/
conftest.py
File metadata and controls
57 lines (38 loc) · 1.16 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
import pytest
from faker import Faker
from model_mommy import mommy
from rolepermissions.roles import assign_role
from pythonpro.cohorts.models import Cohort
@pytest.fixture
def fake():
return Faker('pt_BR')
@pytest.fixture
def client_with_user(client, django_user_model, logged_user):
client.force_login(logged_user)
return client
@pytest.fixture
def logged_user(django_user_model):
logged_user = mommy.make(django_user_model)
return logged_user
@pytest.fixture
def cohort(db):
return mommy.make(Cohort)
@pytest.fixture
def client_with_lead(client, django_user_model, logged_user):
assign_role(logged_user, 'lead')
client.force_login(logged_user)
return client
@pytest.fixture
def client_with_member(client, django_user_model, logged_user):
assign_role(logged_user, 'member')
client.force_login(logged_user)
return client
@pytest.fixture
def client_with_client(client, django_user_model, logged_user):
assign_role(logged_user, 'client')
client.force_login(logged_user)
return client
@pytest.fixture(autouse=True)
def use_db_always(db):
pass
pytest_plugins = ['pythonpro.modules.tests.test_topics_view']