|
6 | 6 | from django.core.exceptions import ImproperlyConfigured |
7 | 7 |
|
8 | 8 | test_apps = [ |
9 | | - # "admin_changelist", |
10 | | - # "admin_checks", |
11 | | - # "admin_custom_urls", |
12 | | - # "admin_docs", |
13 | | - # "admin_filters", |
14 | | - # "admin_inlines", |
15 | | - # "admin_ordering", |
16 | | - # # "admin_scripts", |
17 | | - # # 100+ errors of the form: |
18 | | - # # |
19 | | - # # File "/tmp/django_x2bciiad/tmpogmynqqo/test_project/alternate_settings.py", |
20 | | - # # line 2 |
21 | | - # # {}, 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, \ |
22 | | - # # 'CONN_HEALTH_CHECKS': False, 'TIME_ZONE': None, 'USER': '', \ |
23 | | - # # 'PASSWORD': '', 'HOST': '', 'PORT': '', 'TEST': {'CHARSET': None, \ |
24 | | - # # 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': None}}} |
25 | | - # # ^ |
26 | | - # # SyntaxError: invalid syntax |
27 | | - # "admin_utils", |
28 | | - # "admin_views", |
29 | | - # "admin_widgets", |
30 | | - # "aggregation", |
31 | | - # "aggregation_regress", |
32 | | - # "annotations", |
33 | | - # "apps", |
34 | | - # "async", |
35 | | - # "auth_tests", |
36 | | - # "backends", |
37 | | - # "basic", |
38 | | - # "bulk_create", |
39 | | - # "cache", |
40 | | - # # "check_framework", |
41 | | - # # FAIL: test_collision_across_apps |
42 | | - # # FAIL: test_collision_in_same_app |
43 | | - # # db_table 'test_table' is used by multiple models |
44 | | - # "constraints", |
45 | | - # "contenttypes_tests", |
46 | | - # "context_processors", |
47 | | - # "custom_columns", |
48 | | - # "custom_lookups", |
49 | | - # "custom_managers", |
50 | | - # "custom_pk", |
51 | | - # "datatypes", |
52 | | - # "dates", |
53 | | - # "datetimes", |
54 | | - # "db_functions", |
55 | | - # "defer", |
56 | | - # "defer_regress", |
57 | | - # "delete", |
58 | | - # "delete_regress", |
59 | | - # "empty", |
60 | | - # "empty_models", |
61 | | - # "expressions", |
62 | | - # "expressions_case", |
63 | | - # "field_defaults", |
64 | | - # "file_storage", |
65 | | - # "file_uploads", |
66 | | - # "fixtures", |
67 | | - # "fixtures_model_package", |
68 | | - # "fixtures_regress", |
69 | | - # "flatpages_tests", |
70 | | - # "force_insert_update", |
71 | | - # "foreign_object", |
72 | | - # "forms_tests", |
73 | | - # "from_db_value", |
74 | | - # "generic_inline_admin", |
75 | | - # "generic_relations", |
76 | | - # "generic_relations_regress", |
77 | | - # "generic_views", |
78 | | - # "get_earliest_or_latest", |
79 | | - # "get_object_or_404", |
80 | | - # "get_or_create", |
81 | | - # "i18n", |
82 | | - # "indexes", |
83 | | - # "inline_formsets", |
84 | | - # "introspection", |
85 | | - # "invalid_models_tests", |
86 | | - # "known_related_objects", |
87 | | - # "lookup", |
88 | | - # "m2m_and_m2o", |
89 | | - # "m2m_intermediary", |
90 | | - # "m2m_multiple", |
91 | | - # "m2m_recursive", |
92 | | - # "m2m_regress", |
93 | | - # "m2m_signals", |
94 | | - # "m2m_through", |
95 | | - # "m2m_through_regress", |
96 | | - # "m2o_recursive", |
97 | | - # "managers_regress", |
98 | | - # "many_to_many", |
99 | | - # "many_to_one", |
100 | | - # "many_to_one_null", |
101 | | - # "max_lengths", |
102 | | - # "messages_tests", |
103 | | - # "migrate_signals", |
104 | | - # "migration_test_data_persistence", |
105 | | - # # "migrations", |
106 | | - # # File "/Users/alex.clark/Developer/django-mongodb-cli/src/django/tests/\ |
107 | | - # # migrations/test_commands.py", line 1630, in patched_has_table |
108 | | - # # raise Exception("Other connection") |
109 | | - # # Exception: Other connection |
110 | | - # "model_fields", |
111 | | - # "model_forms", |
112 | | - # "model_formsets", |
113 | | - # "model_formsets_regress", |
114 | | - # "model_indexes", |
115 | | - # "model_inheritance", |
116 | | - # "model_inheritance_regress", |
117 | | - # "model_options", |
118 | | - # "model_package", |
119 | | - # "model_regress", |
120 | | - # "model_utils", |
121 | | - # "modeladmin", |
122 | | - # "multiple_database", |
123 | | - # "mutually_referential", |
124 | | - # "nested_foreign_keys", |
125 | | - # "null_fk", |
126 | | - # "null_fk_ordering", |
127 | | - # "null_queries", |
128 | | - # "one_to_one", |
129 | | - # "or_lookups", |
130 | | - # "order_with_respect_to", |
131 | | - # "ordering", |
132 | | - # "pagination", |
133 | | - # "prefetch_related", |
134 | | - # "proxy_model_inheritance", |
135 | | - # "proxy_models", |
136 | | - # "queries", |
137 | | - # "queryset_pickle", |
138 | | - # "redirects_tests", |
139 | | - # "reserved_names", |
140 | | - # "reverse_lookup", |
141 | | - # "save_delete_hooks", |
142 | | - # "schema", |
143 | | - # "select_for_update", |
144 | | - # "select_related", |
145 | | - # "select_related_onetoone", |
146 | | - # "select_related_regress", |
147 | | - # "serializers", |
148 | | - # "servers", |
149 | | - # "sessions_tests", |
150 | | - # "shortcuts", |
151 | | - # "signals", |
152 | | - # "sitemaps_tests", |
153 | | - # "sites_framework", |
154 | | - # "sites_tests", |
155 | | - # "string_lookup", |
156 | | - # "swappable_models", |
157 | | - # "syndication_tests", |
158 | | - # "test_client", |
159 | | - # "test_client_regress", |
160 | | - # # "test_runner", |
161 | | - # # File "/Users/alex.clark/Developer/django-mongodb-cli/src/django/tests/\ |
162 | | - # # test_runner/test_discover_runner.py", line 809, in test_mixed |
163 | | - # # self.assertEqual(databases, {"default": True, "other": False}) |
164 | | - # # AssertionError: {'default': True, 'other': False, 'encrypted': False} != |
165 | | - # # {'default': True, 'other': False} |
166 | | - # # - {'default': True, 'encrypted': False, 'other': False} |
167 | | - # # ? -------------------- |
168 | | - # # + {'default': True, 'other': False} |
169 | | - # "test_utils", |
170 | | - # "timezones", |
171 | | - # "transactions", |
172 | | - # "unmanaged_models", |
173 | | - # "update", |
174 | | - # "update_only_fields", |
175 | | - # # "user_commands", |
176 | | - # # |
177 | | - # # File "/tmp/django_9gkm5p03/tmpph_i4p8y/test_project/settings.py", line 2 |
178 | | - # # ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, |
179 | | - # # 'CONN_HEALTH_CHECKS': False, 'TIME_ZONE': None, 'USER': '', 'PASSWORD': |
180 | | - # # '', 'HOST': '', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, |
181 | | - # # 'MIGRATE': True, 'MIRROR': None, 'NAME': None}}} |
182 | | - # # ^ |
183 | | - # # SyntaxError: invalid syntax |
184 | | - # "validation", |
185 | | - # "view_tests", |
186 | | - # "xor_lookups", |
| 9 | + "admin_changelist", |
| 10 | + "admin_checks", |
| 11 | + "admin_custom_urls", |
| 12 | + "admin_docs", |
| 13 | + "admin_filters", |
| 14 | + "admin_inlines", |
| 15 | + "admin_ordering", |
| 16 | + "admin_scripts", |
| 17 | + "admin_utils", |
| 18 | + "admin_views", |
| 19 | + "admin_widgets", |
| 20 | + "aggregation", |
| 21 | + "aggregation_regress", |
| 22 | + "annotations", |
| 23 | + "apps", |
| 24 | + "async", |
| 25 | + "auth_tests", |
| 26 | + "backends", |
| 27 | + "basic", |
| 28 | + "bulk_create", |
| 29 | + "cache", |
| 30 | + "check_framework", |
| 31 | + "constraints", |
| 32 | + "contenttypes_tests", |
| 33 | + "context_processors", |
| 34 | + "custom_columns", |
| 35 | + "custom_lookups", |
| 36 | + "custom_managers", |
| 37 | + "custom_pk", |
| 38 | + "datatypes", |
| 39 | + "dates", |
| 40 | + "datetimes", |
| 41 | + "db_functions", |
| 42 | + "defer", |
| 43 | + "defer_regress", |
| 44 | + "delete", |
| 45 | + "delete_regress", |
| 46 | + "empty", |
| 47 | + "empty_models", |
| 48 | + "expressions", |
| 49 | + "expressions_case", |
| 50 | + "field_defaults", |
| 51 | + "file_storage", |
| 52 | + "file_uploads", |
| 53 | + "fixtures", |
| 54 | + "fixtures_model_package", |
| 55 | + "fixtures_regress", |
| 56 | + "flatpages_tests", |
| 57 | + "force_insert_update", |
| 58 | + "foreign_object", |
| 59 | + "forms_tests", |
| 60 | + "from_db_value", |
| 61 | + "generic_inline_admin", |
| 62 | + "generic_relations", |
| 63 | + "generic_relations_regress", |
| 64 | + "generic_views", |
| 65 | + "get_earliest_or_latest", |
| 66 | + "get_object_or_404", |
| 67 | + "get_or_create", |
| 68 | + "i18n", |
| 69 | + "indexes", |
| 70 | + "inline_formsets", |
| 71 | + "introspection", |
| 72 | + "invalid_models_tests", |
| 73 | + "known_related_objects", |
| 74 | + "lookup", |
| 75 | + "m2m_and_m2o", |
| 76 | + "m2m_intermediary", |
| 77 | + "m2m_multiple", |
| 78 | + "m2m_recursive", |
| 79 | + "m2m_regress", |
| 80 | + "m2m_signals", |
| 81 | + "m2m_through", |
| 82 | + "m2m_through_regress", |
| 83 | + "m2o_recursive", |
| 84 | + "managers_regress", |
| 85 | + "many_to_many", |
| 86 | + "many_to_one", |
| 87 | + "many_to_one_null", |
| 88 | + "max_lengths", |
| 89 | + "messages_tests", |
| 90 | + "migrate_signals", |
| 91 | + "migration_test_data_persistence", |
| 92 | + "migrations", |
| 93 | + "model_fields", |
| 94 | + "model_forms", |
| 95 | + "model_formsets", |
| 96 | + "model_formsets_regress", |
| 97 | + "model_indexes", |
| 98 | + "model_inheritance", |
| 99 | + "model_inheritance_regress", |
| 100 | + "model_options", |
| 101 | + "model_package", |
| 102 | + "model_regress", |
| 103 | + "model_utils", |
| 104 | + "modeladmin", |
| 105 | + "multiple_database", |
| 106 | + "mutually_referential", |
| 107 | + "nested_foreign_keys", |
| 108 | + "null_fk", |
| 109 | + "null_fk_ordering", |
| 110 | + "null_queries", |
| 111 | + "one_to_one", |
| 112 | + "or_lookups", |
| 113 | + "order_with_respect_to", |
| 114 | + "ordering", |
| 115 | + "pagination", |
| 116 | + "prefetch_related", |
| 117 | + "proxy_model_inheritance", |
| 118 | + "proxy_models", |
| 119 | + "queries", |
| 120 | + "queryset_pickle", |
| 121 | + "redirects_tests", |
| 122 | + "reserved_names", |
| 123 | + "reverse_lookup", |
| 124 | + "save_delete_hooks", |
| 125 | + "schema", |
| 126 | + "select_for_update", |
| 127 | + "select_related", |
| 128 | + "select_related_onetoone", |
| 129 | + "select_related_regress", |
| 130 | + "serializers", |
| 131 | + "servers", |
| 132 | + "sessions_tests", |
| 133 | + "shortcuts", |
| 134 | + "signals", |
| 135 | + "sitemaps_tests", |
| 136 | + "sites_framework", |
| 137 | + "sites_tests", |
| 138 | + "string_lookup", |
| 139 | + "swappable_models", |
| 140 | + "syndication_tests", |
| 141 | + "test_client", |
| 142 | + "test_client_regress", |
| 143 | + "test_runner", |
| 144 | + "test_utils", |
| 145 | + "timezones", |
| 146 | + "transactions", |
| 147 | + "unmanaged_models", |
| 148 | + "update", |
| 149 | + "update_only_fields", |
| 150 | + "user_commands", |
| 151 | + "validation", |
| 152 | + "view_tests", |
| 153 | + "xor_lookups", |
187 | 154 | # Add directories in django_mongodb_backend/tests |
188 | 155 | *sorted( |
189 | 156 | [ |
|
203 | 170 | else: |
204 | 171 | test_apps.extend(["gis_tests", "gis_tests_"]) |
205 | 172 |
|
206 | | -settings_module = os.environ.get("DJANGO_SETTINGS_MODULE", "mongodb_settings") |
207 | 173 | runtests = pathlib.Path(__file__).parent.resolve() / "runtests.py" |
208 | | -run_tests_cmd = f"python3 {runtests} %s --settings {settings_module} -v 2" |
| 174 | +run_tests_cmd = f"python3 {runtests} %s --settings %s -v 2" |
209 | 175 |
|
210 | 176 | shouldFail = False |
211 | 177 | for app_name in test_apps: |
| 178 | + # Use the custom settings module only for django_mongodb_backend's tests |
| 179 | + # (which always end with an underscore). |
| 180 | + settings_module = ( |
| 181 | + os.environ.get("DJANGO_SETTINGS_MODULE", "mongodb_settings") |
| 182 | + if app_name.endswith("_") |
| 183 | + else "mongodb_settings" |
| 184 | + ) |
212 | 185 | res = os.system(run_tests_cmd % app_name) # noqa: S605 |
213 | 186 | if res != 0: |
214 | 187 | shouldFail = True |
|
0 commit comments