88from unittest .mock import Mock , call
99
1010import pytest
11+
1112import pythonanywhere .django_project
1213from pythonanywhere .django_project import DjangoProject
1314from pythonanywhere .exceptions import SanityException
@@ -283,10 +284,13 @@ def test_updates_wsgi_file_from_template(self):
283284 def test_actually_produces_wsgi_file_that_can_import_project_non_nested (
284285 self , fake_home , non_nested_submodule , virtualenvs_folder
285286 ):
286- project = DjangoProject ("mydomain.com" , "." .join (python_version ().split ("." )[:2 ]))
287+ running_python_version = "." .join (python_version ().split ("." )[:2 ])
288+ project = DjangoProject ("mydomain.com" , running_python_version )
287289 shutil .copytree (str (non_nested_submodule ), str (project .project_path ))
288- print (subprocess .check_call (["tree" , str (project .project_path )]))
289- project .create_virtualenv ()
290+ if running_python_version == "3.7" :
291+ project .create_virtualenv (django_version = "latest" )
292+ else :
293+ project .create_virtualenv ()
290294 project .find_django_files ()
291295 project .wsgi_file_path = Path (tempfile .NamedTemporaryFile ().name )
292296
@@ -299,9 +303,13 @@ def test_actually_produces_wsgi_file_that_can_import_project_non_nested(
299303 def test_actually_produces_wsgi_file_that_can_import_nested_project (
300304 self , fake_home , more_nested_submodule , virtualenvs_folder
301305 ):
302- project = DjangoProject ("mydomain.com" , "." .join (python_version ().split ("." )[:2 ]))
306+ running_python_version = "." .join (python_version ().split ("." )[:2 ])
307+ project = DjangoProject ("mydomain.com" , running_python_version )
303308 shutil .copytree (str (more_nested_submodule ), str (project .project_path ))
304- project .create_virtualenv ()
309+ if running_python_version == "3.7" :
310+ project .create_virtualenv (django_version = "latest" )
311+ else :
312+ project .create_virtualenv ()
305313 project .find_django_files ()
306314 project .wsgi_file_path = Path (tempfile .NamedTemporaryFile ().name )
307315
0 commit comments