()
| 3 | |
| 4 | |
| 5 | def main(): |
| 6 | repo_root = Path(__file__).resolve().parent.parent |
| 7 | sys.path[:0] = [str(repo_root / "tests"), str(repo_root)] |
| 8 | |
| 9 | from runtests import ALWAYS_INSTALLED_APPS, get_apps_to_install, get_test_modules |
| 10 | |
| 11 | import django |
| 12 | from django.apps import apps |
| 13 | from django.core.management import call_command |
| 14 | |
| 15 | django.setup() |
| 16 | |
| 17 | test_modules = list(get_test_modules(gis_enabled=False)) |
| 18 | installed_apps = list(ALWAYS_INSTALLED_APPS) |
| 19 | for app in get_apps_to_install(test_modules): |
| 20 | # Check against the list to prevent duplicate errors. |
| 21 | if app not in installed_apps: |
| 22 | installed_apps.append(app) |
| 23 | apps.set_installed_apps(installed_apps) |
| 24 | |
| 25 | # Note: We don't use check=True here because --check calls sys.exit(1) |
| 26 | # instead of raising CommandError when migrations are missing. |
| 27 | call_command("makemigrations", "--check", verbosity=3) |
| 28 | |
| 29 | |
| 30 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…