Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Test artifacts
/tmp/test-output*/
/tmp/test-projects/
tests/__pycache__/
tests/.pytest_cache/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test-gen:

test-full:
@echo "Running full test suite..."
$(PYTHON) run_tests.py
$(PYTHON) tests/run_tests.py

test: test-basic test-gen test-full
@echo "All tests completed!"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ make tox-all # Run all tox environments

```bash
# Individual test scripts
python validate_template.py # Comprehensive validation
python quick_test.py # Quick validation
python run_tests.py # Full test suite
python -m pytest test_cookiecutter.py -v # Pytest tests
python validate_template.py # Comprehensive validation
python tests/quick_test.py # Quick validation
python tests/run_tests.py # Full test suite
python -m pytest tests/test_cookiecutter.py -v # Pytest tests
```

### Available Tox Environments
Expand Down
6 changes: 6 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
Tests for the Django OAuth2 Cookiecutter template.

This package contains all test files for validating the cookiecutter template
structure, functionality, and generated project quality.
"""
2 changes: 1 addition & 1 deletion quick_test.py → tests/quick_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def main():
print("Django OAuth2 Cookiecutter Template - Quick Validation")
print("=" * 60)

template_dir = os.path.dirname(os.path.abspath(__file__))
template_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
errors = []

# Test 1: Check cookiecutter.json exists and is valid
Expand Down
2 changes: 1 addition & 1 deletion run_tests.py → tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def run_basic_validation():
# Run the validation script
result = subprocess.run([
python_exe,
os.path.join(os.path.dirname(__file__), "validate_template.py")
os.path.join(os.path.dirname(os.path.dirname(__file__)), "validate_template.py")
], capture_output=True, text=True)

if result.returncode == 0:
Expand Down
2 changes: 1 addition & 1 deletion test_cookiecutter.py → tests/test_cookiecutter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def temp_dir():
@pytest.fixture
def template_dir():
"""Get the template directory path."""
return os.path.dirname(os.path.abspath(__file__))
return os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


@pytest.fixture
Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ skip_missing_interpreters = true
deps =
-r{toxinidir}/test-requirements.txt
commands =
python -m pytest test_cookiecutter.py -v
python -m pytest tests/test_cookiecutter.py -v

[testenv:validate]
deps =
Expand All @@ -19,13 +19,13 @@ commands =
deps =
-r{toxinidir}/test-requirements.txt
commands =
python quick_test.py
python tests/quick_test.py

[testenv:template-test]
deps =
-r{toxinidir}/test-requirements.txt
commands =
python run_tests.py
python tests/run_tests.py

[testenv:lint]
deps =
Expand All @@ -50,7 +50,7 @@ deps =
-r{toxinidir}/test-requirements.txt
coverage>=7.0.0
commands =
coverage run -m pytest test_cookiecutter.py
coverage run -m pytest tests/test_cookiecutter.py
coverage report -m
coverage html
coverage xml
Expand All @@ -60,8 +60,8 @@ deps =
-r{toxinidir}/test-requirements.txt
commands =
python validate_template.py
python quick_test.py
python -m pytest test_cookiecutter.py -v
python tests/quick_test.py
python -m pytest tests/test_cookiecutter.py -v

[flake8]
max-line-length = 88
Expand Down