mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Simplified register_models.
Since it's never called with more than one model at a time the current signature is needlessly complicated.
This commit is contained in:
@@ -151,7 +151,7 @@ class MakeMigrationsTests(MigrationTestBase):
|
||||
|
||||
def test_files_content(self):
|
||||
self.assertTableNotExists("migrations_unicodemodel")
|
||||
app_cache.register_models('migrations', UnicodeModel)
|
||||
app_cache.register_model('migrations', UnicodeModel)
|
||||
with override_settings(MIGRATION_MODULES={"migrations": self.migration_pkg}):
|
||||
call_command("makemigrations", "migrations", verbosity=0)
|
||||
|
||||
@@ -187,7 +187,7 @@ class MakeMigrationsTests(MigrationTestBase):
|
||||
|
||||
def test_failing_migration(self):
|
||||
#21280 - If a migration fails to serialize, it shouldn't generate an empty file.
|
||||
app_cache.register_models('migrations', UnserializableModel)
|
||||
app_cache.register_model('migrations', UnserializableModel)
|
||||
|
||||
with six.assertRaisesRegex(self, ValueError, r'Cannot serialize'):
|
||||
with override_settings(MIGRATION_MODULES={"migrations": self.migration_pkg}):
|
||||
|
||||
Reference in New Issue
Block a user