Skip to content

Commit

Permalink
Fix test_django
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Aug 19, 2020
1 parent 5749240 commit 53f662d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/test_django.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pytest
from pyscaffold import __version__ as pyscaffold_version
from pyscaffold.api import NO_CONFIG, create_project
from pyscaffold.cli import parse_args, run
from pyscaffold.templates import get_template
Expand All @@ -18,7 +19,14 @@
@pytest.mark.slow
def test_create_project_with_django(tmpfolder):
# Given options with the django extension,
opts = dict(project_path=PROJ_NAME, extensions=[Django()], config_files=NO_CONFIG)
opts = dict(
project_path=PROJ_NAME,
name=PROJ_NAME,
package=PROJ_NAME,
extensions=[Django()],
version=pyscaffold_version,
config_files=NO_CONFIG,
)
# NO_CONFIG: avoid extra config from dev's machine interference

# when the project is created,
Expand All @@ -28,7 +36,7 @@ def test_create_project_with_django(tmpfolder):
for path in DJANGO_FILES:
assert Path(path).exists()
# and also overwritable pyscaffold files (with the exact contents)
existing = (tmpfolder / PROJ_NAME / "setup.py").read()
existing = (tmpfolder / PROJ_NAME / "setup.py").read_text()
assert existing == get_template("setup_py").safe_substitute(opts)


Expand Down

0 comments on commit 53f662d

Please sign in to comment.