summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-12-24 22:43:28 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-12-29 21:58:12 +0100
commit02f3daadd6c4f4ae2ab4f37c6e4c523f438c205e (patch)
tree58cb05c27c3ab2e6565e3e3c20e803774565bada /tests
parent59ddb79e9090f8609f9125379db08adc95d507c0 (diff)
Removed interpolation of post_url_continue in the admin.
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/admin_custom_urls/models.py12
-rw-r--r--tests/regressiontests/admin_custom_urls/tests.py20
2 files changed, 1 insertions, 31 deletions
diff --git a/tests/regressiontests/admin_custom_urls/models.py b/tests/regressiontests/admin_custom_urls/models.py
index cc8e730c26..45b6ed57a9 100644
--- a/tests/regressiontests/admin_custom_urls/models.py
+++ b/tests/regressiontests/admin_custom_urls/models.py
@@ -71,18 +71,6 @@ class CarAdmin(admin.ModelAdmin):
request, obj, post_url_continue=reverse('admin:admin_custom_urls_car_history', args=[obj.pk]))
-class CarDeprecated(models.Model):
- """ This class must be removed in Django 1.6 """
- name = models.CharField(max_length=20)
-
-class CarDeprecatedAdmin(admin.ModelAdmin):
- """ This class must be removed in Django 1.6 """
- def response_add(self, request, obj, post_url_continue=None):
- return super(CarDeprecatedAdmin, self).response_add(
- request, obj, post_url_continue='../%s/history/')
-
-
admin.site.register(Action, ActionAdmin)
admin.site.register(Person, PersonAdmin)
admin.site.register(Car, CarAdmin)
-admin.site.register(CarDeprecated, CarDeprecatedAdmin) \ No newline at end of file
diff --git a/tests/regressiontests/admin_custom_urls/tests.py b/tests/regressiontests/admin_custom_urls/tests.py
index d691a97557..a7edc77c38 100644
--- a/tests/regressiontests/admin_custom_urls/tests.py
+++ b/tests/regressiontests/admin_custom_urls/tests.py
@@ -7,7 +7,7 @@ from django.template.response import TemplateResponse
from django.test import TestCase
from django.test.utils import override_settings
-from .models import Action, Person, Car, CarDeprecated
+from .models import Action, Person, Car
@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
@@ -122,21 +122,3 @@ class CustomRedirects(TestCase):
self.assertEqual(len(cars), 1)
self.assertRedirects(
response, reverse('admin:admin_custom_urls_car_history', args=[cars[0].pk]))
-
- def test_post_url_continue_string_formats(self):
- """
- Ensures that string formats are accepted for post_url_continue. This
- is a deprecated functionality that will be removed in Django 1.6 along
- with this test.
- """
- with warnings.catch_warnings(record=True) as w:
- post_data = { 'name': 'SuperFast', '_continue': '1' }
- self.assertEqual(Car.objects.count(), 0)
- response = self.client.post(
- reverse('admin:admin_custom_urls_cardeprecated_add'), post_data)
- cars = CarDeprecated.objects.all()
- self.assertEqual(len(cars), 1)
- self.assertRedirects(
- response, reverse('admin:admin_custom_urls_cardeprecated_history', args=[cars[0].pk]))
- self.assertEqual(len(w), 1)
- self.assertTrue(isinstance(w[0].message, DeprecationWarning)) \ No newline at end of file