Ticket #10223: 10223-test.diff
File 10223-test.diff, 1.4 KB (added by , 16 years ago) |
---|
-
tests/regressiontests/admin_views/tests.py
231 231 "Changelist filter isn't showing options contained inside a model field 'choices' option named group." 232 232 ) 233 233 234 def test_shortcut_with_slash(self): 235 obj = ModelWithStringPrimaryKey.objects.create(id="pk/with/slashes") 236 short_url = '/test_admin/admin2/r/%s/%s/' % (ContentType.objects.get_for_model(ModelWithStringPrimaryKey).id, obj.pk) 237 response = self.client.get(short_url) 238 self.assertRedirects(response, 'http://example.com%s' % obj.get_absolute_url(), 239 status_code=302, target_status_code=404) 240 234 241 class CustomModelAdminTest(AdminViewBasicTest): 235 242 urlbit = "admin2" 236 243 -
tests/regressiontests/admin_views/models.py
119 119 120 120 def __unicode__(self): 121 121 return self.id 122 123 def get_absolute_url(self): 124 return "/"+self.id 122 125 123 126 class Color(models.Model): 124 127 value = models.CharField(max_length=10)