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
42 lines (30 loc) · 950 Bytes
/
conftest.py
File metadata and controls
42 lines (30 loc) · 950 Bytes
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
import pytest
from faker import Faker
from model_mommy import mommy
from rolepermissions.roles import assign_role
@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 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