init
This commit is contained in:
0
src/tests/__init__.py
Normal file
0
src/tests/__init__.py
Normal file
19
src/tests/conftest.py
Normal file
19
src/tests/conftest.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import pytest
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def enable_db_access_for_all_tests(db):
|
||||
"""
|
||||
This fixture enables database access for all tests.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def test_user():
|
||||
return User.objects.create_user(
|
||||
username='test_user',
|
||||
email="test_user@test.com",
|
||||
password="test_password"
|
||||
)
|
0
src/tests/test_app_1/__init__.py
Normal file
0
src/tests/test_app_1/__init__.py
Normal file
5
src/tests/test_app_1/test_example.py
Normal file
5
src/tests/test_app_1/test_example.py
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
def test_example(test_user):
|
||||
assert test_user.username == 'test_user'
|
||||
assert test_user.email is not None
|
||||
|
Reference in New Issue
Block a user