From 42aa919de9ef9d039a72e468bdb4e868daa32e5c Mon Sep 17 00:00:00 2001 From: Marten Kenbeek Date: Tue, 30 Jun 2015 20:38:07 +0200 Subject: [PATCH] [1.8.x] Refs #23621 -- Fixed warning message when reloading models. Backport of aabb58428beae0bd34f32e5d620a82486b670499 from master --- django/apps/registry.py | 2 +- tests/apps/tests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django/apps/registry.py b/django/apps/registry.py index 0cda55d8fa1..2a496affdaa 100644 --- a/django/apps/registry.py +++ b/django/apps/registry.py @@ -213,7 +213,7 @@ class Apps(object): warnings.warn( "Model '%s.%s' was already registered. " "Reloading models is not advised as it can lead to inconsistencies, " - "most notably with related models." % (model_name, app_label), + "most notably with related models." % (app_label, model_name), RuntimeWarning, stacklevel=2) else: raise RuntimeError( diff --git a/tests/apps/tests.py b/tests/apps/tests.py index 4d7cd562a34..8c9f815a368 100644 --- a/tests/apps/tests.py +++ b/tests/apps/tests.py @@ -234,7 +234,7 @@ class AppsTests(TestCase): self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[-1].category, RuntimeWarning)) self.assertEqual(str(w[-1].message), - "Model 'southponies.apps' was already registered. " + "Model 'apps.southponies' was already registered. " "Reloading models is not advised as it can lead to inconsistencies, " "most notably with related models.")