[py3] Fixed admin_custom_urls tests.
This commit is contained in:
parent
0c198b85a3
commit
d6b8b125fb
|
@ -28,7 +28,7 @@ class ActionAdmin(admin.ModelAdmin):
|
||||||
Remove all entries named 'name' from the ModelAdmin instance URL
|
Remove all entries named 'name' from the ModelAdmin instance URL
|
||||||
patterns list
|
patterns list
|
||||||
"""
|
"""
|
||||||
return filter(lambda e: e.name != name, super(ActionAdmin, self).get_urls())
|
return [url for url in super(ActionAdmin, self).get_urls() if url.name != name]
|
||||||
|
|
||||||
def get_urls(self):
|
def get_urls(self):
|
||||||
# Add the URL of our custom 'add_view' view to the front of the URLs
|
# Add the URL of our custom 'add_view' view to the front of the URLs
|
||||||
|
|
|
@ -29,10 +29,7 @@ class AdminCustomUrlsTest(TestCase):
|
||||||
def testAddWithGETArgs(self):
|
def testAddWithGETArgs(self):
|
||||||
response = self.client.get('/custom_urls/admin/admin_custom_urls/action/!add/', {'name': 'My Action'})
|
response = self.client.get('/custom_urls/admin/admin_custom_urls/action/!add/', {'name': 'My Action'})
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertTrue(
|
self.assertContains(response, 'value="My Action"')
|
||||||
'value="My Action"' in response.content,
|
|
||||||
"Couldn't find an input with the right value in the response."
|
|
||||||
)
|
|
||||||
|
|
||||||
def testBasicAddPost(self):
|
def testBasicAddPost(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue