@@ -247,19 +247,21 @@ def test_nuke_option_handles_directory_not_existing(self, mock_subprocess, fake_
247247
248248
249249@pytest .fixture
250- def non_nested_submodule ():
250+ def non_nested_submodule (running_python_version ):
251+ git_ref = "non-nested-old" if running_python_version in ["3.8" , "3.9" ] else "master"
251252 subprocess .check_call (["git" , "submodule" , "update" , "--init" , "--recursive" ])
252253 submodule_path = Path (__file__ ).parents [1 ] / "submodules" / "example-django-project"
253- subprocess .check_call (["git" , "checkout" , "master" ], cwd = str (submodule_path ))
254+ subprocess .check_call (["git" , "checkout" , git_ref ], cwd = str (submodule_path ))
254255 yield submodule_path
255256 subprocess .check_call (["git" , "submodule" , "update" , "--init" , "--recursive" ])
256257
257258
258259@pytest .fixture
259- def more_nested_submodule ():
260+ def more_nested_submodule (running_python_version ):
261+ git_ref = "more-nested-old" if running_python_version in ["3.8" , "3.9" ] else "morenested"
260262 subprocess .check_call (["git" , "submodule" , "update" , "--init" , "--recursive" ])
261263 submodule_path = Path (__file__ ).parents [1 ] / "submodules" / "example-django-project"
262- subprocess .check_call (["git" , "checkout" , "morenested" ], cwd = str (submodule_path ))
264+ subprocess .check_call (["git" , "checkout" , git_ref ], cwd = str (submodule_path ))
263265 yield submodule_path
264266 subprocess .check_call (["git" , "submodule" , "update" , "--init" , "--recursive" ])
265267
@@ -509,9 +511,8 @@ def test_updates_wsgi_file_from_template(self, virtualenvs_folder):
509511
510512 @pytest .mark .slowtest
511513 def test_actually_produces_wsgi_file_that_can_import_project_non_nested (
512- self , fake_home , non_nested_submodule , virtualenvs_folder
514+ self , fake_home , non_nested_submodule , virtualenvs_folder , running_python_version
513515 ):
514- running_python_version = "." .join (python_version ().split ("." )[:2 ])
515516 project = DjangoProject ("mydomain.com" , running_python_version )
516517 shutil .copytree (str (non_nested_submodule ), str (project .project_path ))
517518 if running_python_version in ["3.8" , "3.9" , "3.10" , "3.11" ]:
@@ -529,15 +530,14 @@ def test_actually_produces_wsgi_file_that_can_import_project_non_nested(
529530
530531 @pytest .mark .slowtest
531532 def test_actually_produces_wsgi_file_that_can_import_nested_project (
532- self , fake_home , more_nested_submodule , virtualenvs_folder
533+ self , fake_home , more_nested_submodule , virtualenvs_folder , running_python_version
533534 ):
534- running_python_version = "." .join (python_version ().split ("." )[:2 ])
535535 project = DjangoProject ("mydomain.com" , running_python_version )
536536 shutil .copytree (str (more_nested_submodule ), str (project .project_path ))
537- if running_python_version in ["3.8" , "3.9" , "3.10" , "3.11" ]:
538- project .create_virtualenv (django_version = "latest" )
539- else :
537+ if running_python_version in ["3.8" , "3.9" ]:
540538 project .create_virtualenv ()
539+ else :
540+ project .create_virtualenv (django_version = "latest" )
541541
542542 project .find_django_files ()
543543 project .wsgi_file_path = Path (tempfile .NamedTemporaryFile ().name )
0 commit comments