summaryrefslogtreecommitdiff
path: root/tests/admin_custom_urls
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-04-07 22:04:45 -0400
committerTim Graham <timograham@gmail.com>2016-04-08 10:12:33 -0400
commit92053acbb9160862c3e743a99ed8ccff8d4f8fd6 (patch)
tree50e7fd28a650f0e2352cf94f92e5a66d28a81988 /tests/admin_custom_urls
parentdf8d8d4292684d6ffa7474f1e201aed486f02b53 (diff)
Fixed E128 flake8 warnings in tests/.
Diffstat (limited to 'tests/admin_custom_urls')
-rw-r--r--tests/admin_custom_urls/tests.py30
1 files changed, 13 insertions, 17 deletions
diff --git a/tests/admin_custom_urls/tests.py b/tests/admin_custom_urls/tests.py
index 0a78b1afe9..11a0375ae2 100644
--- a/tests/admin_custom_urls/tests.py
+++ b/tests/admin_custom_urls/tests.py
@@ -73,15 +73,16 @@ class AdminCustomUrlsTest(TestCase):
"""
# Should get the change_view for model instance with PK 'add', not show
# the add_view
- url = reverse('admin_custom_urls:%s_action_change' % Action._meta.app_label,
- args=(quote('add'),))
+ url = reverse('admin_custom_urls:%s_action_change' % Action._meta.app_label, args=(quote('add'),))
response = self.client.get(url)
self.assertContains(response, 'Change action')
# Should correctly get the change_view for the model instance with the
# funny-looking PK (the one with a 'path/to/html/document.html' value)
- url = reverse('admin_custom_urls:%s_action_change' % Action._meta.app_label,
- args=(quote("path/to/html/document.html"),))
+ url = reverse(
+ 'admin_custom_urls:%s_action_change' % Action._meta.app_label,
+ args=(quote("path/to/html/document.html"),)
+ )
response = self.client.get(url)
self.assertContains(response, 'Change action')
self.assertContains(response, 'value="path/to/html/document.html"')
@@ -95,12 +96,11 @@ class AdminCustomUrlsTest(TestCase):
"""
post_data = {'name': 'John Doe'}
self.assertEqual(Person.objects.count(), 0)
- response = self.client.post(
- reverse('admin_custom_urls:admin_custom_urls_person_add'), post_data)
+ response = self.client.post(reverse('admin_custom_urls:admin_custom_urls_person_add'), post_data)
persons = Person.objects.all()
self.assertEqual(len(persons), 1)
- self.assertRedirects(
- response, reverse('admin_custom_urls:admin_custom_urls_person_history', args=[persons[0].pk]))
+ redirect_url = reverse('admin_custom_urls:admin_custom_urls_person_history', args=[persons[0].pk])
+ self.assertRedirects(response, redirect_url)
def test_post_save_change_redirect(self):
"""
@@ -112,11 +112,9 @@ class AdminCustomUrlsTest(TestCase):
Person.objects.create(name='John Doe')
self.assertEqual(Person.objects.count(), 1)
person = Person.objects.all()[0]
- post_data = {'name': 'Jack Doe'}
- response = self.client.post(
- reverse('admin_custom_urls:admin_custom_urls_person_change', args=[person.pk]), post_data)
- self.assertRedirects(
- response, reverse('admin_custom_urls:admin_custom_urls_person_delete', args=[person.pk]))
+ post_url = reverse('admin_custom_urls:admin_custom_urls_person_change', args=[person.pk])
+ response = self.client.post(post_url, {'name': 'Jack Doe'})
+ self.assertRedirects(response, reverse('admin_custom_urls:admin_custom_urls_person_delete', args=[person.pk]))
def test_post_url_continue(self):
"""
@@ -125,9 +123,7 @@ class AdminCustomUrlsTest(TestCase):
"""
post_data = {'name': 'SuperFast', '_continue': '1'}
self.assertEqual(Car.objects.count(), 0)
- response = self.client.post(
- reverse('admin_custom_urls:admin_custom_urls_car_add'), post_data)
+ response = self.client.post(reverse('admin_custom_urls:admin_custom_urls_car_add'), post_data)
cars = Car.objects.all()
self.assertEqual(len(cars), 1)
- self.assertRedirects(
- response, reverse('admin_custom_urls:admin_custom_urls_car_history', args=[cars[0].pk]))
+ self.assertRedirects(response, reverse('admin_custom_urls:admin_custom_urls_car_history', args=[cars[0].pk]))