diff options
| author | j0hnsmith <info@whywouldwe.com> | 2015-11-06 22:55:44 +0000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-11-07 21:19:25 +0100 |
| commit | 0115f9faa517bba882a31b0ade076601b5a41de6 (patch) | |
| tree | 3389205d2d5c43eecfe9587808f1f8612338c36d /tests/sites_tests | |
| parent | 81006b9657534a21c3eadb2bc4a87c46db54c099 (diff) | |
Fixed #25692 -- Added natural keys support to Site model.
Diffstat (limited to 'tests/sites_tests')
| -rw-r--r-- | tests/sites_tests/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/sites_tests/tests.py b/tests/sites_tests/tests.py index a5ce7a6779..6bf7ce4d0b 100644 --- a/tests/sites_tests/tests.py +++ b/tests/sites_tests/tests.py @@ -179,6 +179,10 @@ class SitesFrameworkTests(TestCase): with self.assertRaisesMessage(ValidationError, msg): site.validate_unique() + def test_site_natural_key(self): + self.assertEqual(Site.objects.get_by_natural_key(self.site.domain), self.site) + self.assertEqual(self.site.natural_key(), (self.site.domain,)) + class JustOtherRouter(object): def allow_migrate(self, db, app_label, **hints): |
