WIP: new updates #48

Closed
S4NKALP wants to merge 32 commits from dev into main
pull from: dev
3 changed files with 63 additions and 0 deletions
Showing only changes of commit 1bb3443237 - Show all commits

No files matched your search

@@ -0,0 +1,46 @@
#--------------------------------------------------#
# The following was generated by djinit: #
#--------------------------------------------------#
import os
import sys
import django
from pathlib import Path
# Add project to path
sys.path.insert(0, str(Path(__file__).parent.parent))
# Configure Django settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '[[ module_name ]].settings.development')
django.setup()
import pytest
@pytest.fixture(scope="session")
def django_db_setup():
"""Setup test database."""
from django.conf import settings
settings.DATABASES['default'] = {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
@pytest.fixture
def api_client():
"""Return a test client."""
from rest_framework.test import APIClient
return APIClient()
@pytest.fixture
def user(db):
"""Create a test user."""
from django.contrib.auth import get_user_model
User = get_user_model()
return User.objects.create_user(
username='testuser',
email='test@example.com',
password='testpass123'
)
@@ -0,0 +1,14 @@
#--------------------------------------------------#
# The following was generated by djinit: #
#--------------------------------------------------#
[pytest]
DJANGO_SETTINGS_MODULE = [[ module_name ]].settings.development
python_files = tests.py test_*.py *_tests.py
python_classes = Test* *Tests *Test
python_functions = test_*
addopts = --strict-markers --tb=short
testpaths = [[ app_names ]]
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
integration: marks tests as integration tests
@@ -13,6 +13,9 @@ whitenoise
django-tailwind-cli # @IF use_tailwind
django-htmx # @IF use_htmx
django-vite # @IF use_vite
pytest # @IF use_pytest
pytest-django # @IF use_pytest
pytest-cov # @IF use_pytest
# @IF database_type == 'mysql'
mysqlclient
# @ELSE