-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
32 lines (25 loc) · 736 Bytes
/
conftest.py
File metadata and controls
32 lines (25 loc) · 736 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
import pytest
from django.contrib.auth import get_user_model
User = get_user_model()
@pytest.fixture
def user(db):
"""Handle user.
Supports the module workflow with a focused operation."""
return User.objects.create_user(
username="testuser",
password="testpass123",
)
@pytest.fixture
def admin_user(db):
"""Handle admin user.
Supports the module workflow with a focused operation."""
return User.objects.create_superuser(
username="admin",
password="adminpass123",
)
@pytest.fixture
def admin_client(admin_user, client):
"""Handle admin client.
Supports the module workflow with a focused operation."""
client.force_login(admin_user)
return client