@@ -502,9 +502,7 @@ def test_enable_qe_activates_settings(tmp_path):
502502 "# from .qe import * # noqa\n "
503503 "# INSTALLED_APPS += QE_INSTALLED_APPS # noqa: F405\n "
504504 )
505- (settings_dir / "qe.py" ).write_text (
506- 'QE_INSTALLED_APPS = ["medical_records.medical_records_django"]\n '
507- )
505+ (settings_dir / "qe.py" ).write_text ('QE_INSTALLED_APPS = ["medical_records"]\n ' )
508506
509507 _enable_qe (tmp_path , "myproject" )
510508
@@ -514,48 +512,6 @@ def test_enable_qe_activates_settings(tmp_path):
514512 assert "INSTALLED_APPS += QE_INSTALLED_APPS # noqa: F405" in content
515513
516514
517- def test_enable_qe_uses_django_app_by_default (tmp_path ):
518- """Test that _enable_qe leaves medical_records.medical_records_django when wagtail=False."""
519- from dbx_python_cli .commands .project import _enable_qe
520-
521- settings_dir = tmp_path / "myproject" / "settings"
522- settings_dir .mkdir (parents = True )
523- (settings_dir / "myproject.py" ).write_text (
524- "# from .qe import * # noqa\n "
525- "# INSTALLED_APPS += QE_INSTALLED_APPS # noqa: F405\n "
526- )
527- qe_file = settings_dir / "qe.py"
528- qe_file .write_text (
529- 'QE_INSTALLED_APPS = ["medical_records.medical_records_django"]\n '
530- )
531-
532- _enable_qe (tmp_path , "myproject" , wagtail = False )
533-
534- assert '"medical_records.medical_records_django"' in qe_file .read_text ()
535-
536-
537- def test_enable_qe_uses_wagtail_app_when_stacked (tmp_path ):
538- """Test that _enable_qe replaces app with medical_records.medical_records_wagtail when wagtail=True."""
539- from dbx_python_cli .commands .project import _enable_qe
540-
541- settings_dir = tmp_path / "myproject" / "settings"
542- settings_dir .mkdir (parents = True )
543- (settings_dir / "myproject.py" ).write_text (
544- "# from .qe import * # noqa\n "
545- "# INSTALLED_APPS += QE_INSTALLED_APPS # noqa: F405\n "
546- )
547- qe_file = settings_dir / "qe.py"
548- qe_file .write_text (
549- 'QE_INSTALLED_APPS = ["medical_records.medical_records_django"]\n '
550- )
551-
552- _enable_qe (tmp_path , "myproject" , wagtail = True )
553-
554- qe_content = qe_file .read_text ()
555- assert '"medical_records.medical_records_wagtail"' in qe_content
556- assert '"medical_records.medical_records_django"' not in qe_content
557-
558-
559515def test_create_pyproject_toml_includes_pymongocrypt_when_qe (tmp_path ):
560516 """Test that _create_pyproject_toml adds pymongocrypt to dependencies when qe=True."""
561517 from dbx_python_cli .commands .project import _create_pyproject_toml
@@ -582,11 +538,11 @@ def test_create_pyproject_toml_excludes_pymongocrypt_by_default(tmp_path):
582538 assert '"pymongocrypt"' not in deps_section
583539
584540
585- def test_qe_with_medical_records_adds_django_app_to_installed_apps (tmp_path ):
586- """When --qe and --with medical-records are both used, medical_records.medical_records_django must be in INSTALLED_APPS.
541+ def test_qe_with_medical_records_adds_app_to_installed_apps (tmp_path ):
542+ """When --qe and --with medical-records are both used, medical_records must be in INSTALLED_APPS.
587543
588544 _enable_qe uncomments the QE import block in the project settings, which adds
589- QE_INSTALLED_APPS (containing medical_records.medical_records_django ) to INSTALLED_APPS.
545+ QE_INSTALLED_APPS (containing medical_records) to INSTALLED_APPS.
590546 """
591547 from dbx_python_cli .commands .project import _enable_qe
592548
@@ -598,13 +554,11 @@ def test_qe_with_medical_records_adds_django_app_to_installed_apps(tmp_path):
598554 "# INSTALLED_APPS += QE_INSTALLED_APPS # noqa: F405\n "
599555 )
600556 qe_file = settings_dir / "qe.py"
601- qe_file .write_text (
602- 'QE_INSTALLED_APPS = ["medical_records.medical_records_django"]\n '
603- )
557+ qe_file .write_text ('QE_INSTALLED_APPS = ["medical_records"]\n ' )
604558
605559 _enable_qe (tmp_path , "myproject" )
606560
607561 settings_content = settings_file .read_text ()
608562 assert "from .qe import * # noqa" in settings_content
609563 assert "INSTALLED_APPS += QE_INSTALLED_APPS # noqa: F405" in settings_content
610- assert '"medical_records.medical_records_django "' in qe_file .read_text ()
564+ assert '"medical_records"' in qe_file .read_text ()
0 commit comments