summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarten Kenbeek <marten.knbk@gmail.com>2015-06-30 20:38:07 +0200
committerTim Graham <timograham@gmail.com>2015-06-30 15:01:28 -0400
commit9bd3a2325e22bdc034ec2646afc412a1d3f16a71 (patch)
treebd2a01e054f46f58c9f16d3eaddcb9399b946486
parent1efda84a950e9ec90961296aa64568c45f25c1e9 (diff)
downloaddjango-9bd3a2325e22bdc034ec2646afc412a1d3f16a71.tar.gz
[1.7.x] Refs #23621 -- Fixed warning message when reloading models.
Backport of aabb58428beae0bd34f32e5d620a82486b670499 from master
-rw-r--r--django/apps/registry.py2
-rw-r--r--tests/apps/tests.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/django/apps/registry.py b/django/apps/registry.py
index fe53d965de..b26354b823 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 f6bef17e42..8252ab46d6 100644
--- a/tests/apps/tests.py
+++ b/tests/apps/tests.py
@@ -235,7 +235,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.")