Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added complementary regression test for commit c172951

Also fixed #18660.
  • Loading branch information...
commit c9c9a5642512155e9693bf5fa6221fd26adeccca 1 parent 50d573d
@eduardocereto eduardocereto authored claudep committed
View
3  tests/regressiontests/admin_inlines/models.py
@@ -57,6 +57,9 @@ class Inner(models.Model):
holder = models.ForeignKey(Holder)
readonly = models.CharField("Inner readonly label", max_length=1)
+ def get_absolute_url(self):
+ return '/inner/'
+
class Holder2(models.Model):
dummy = models.IntegerField()
View
12 tests/regressiontests/admin_inlines/tests.py
@@ -148,6 +148,18 @@ def test_non_related_name_inline(self):
'<input id="id_-2-0-name" type="text" class="vTextField" '
'name="-2-0-name" maxlength="100" />', html=True)
+ @override_settings(USE_L10N=True, USE_THOUSAND_SEPARATOR=True)
+ def test_localize_pk_shortcut(self):
+ """
+ Ensure that the "View on Site" link is correct for locales that use
+ thousand separators
+ """
+ holder = Holder.objects.create(pk=123456789, dummy=42)
+ inner = Inner.objects.create(pk=987654321, holder=holder, dummy=42, readonly='')
+ response = self.client.get('/admin/admin_inlines/holder/%i/' % holder.id)
+ inner_shortcut = 'r/%s/%s/'%(ContentType.objects.get_for_model(inner).pk, inner.pk)
+ self.assertContains(response, inner_shortcut)
+
def test_custom_pk_shortcut(self):
"""
Ensure that the "View on Site" link is correct for models with a

0 comments on commit c9c9a56

Please sign in to comment.
Something went wrong with that request. Please try again.