aboutsummaryrefslogtreecommitdiffstats
path: root/tests/browsable_api/test_browsable_api.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/browsable_api/test_browsable_api.py')
-rw-r--r--tests/browsable_api/test_browsable_api.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/browsable_api/test_browsable_api.py b/tests/browsable_api/test_browsable_api.py
index 5f264783..31907f84 100644
--- a/tests/browsable_api/test_browsable_api.py
+++ b/tests/browsable_api/test_browsable_api.py
@@ -3,6 +3,7 @@ from django.contrib.auth.models import User
from django.test import TestCase
from rest_framework.test import APIClient
+from .models import Foo, Bar
class DropdownWithAuthTests(TestCase):
@@ -16,6 +17,8 @@ class DropdownWithAuthTests(TestCase):
self.email = 'lennon@thebeatles.com'
self.password = 'password'
self.user = User.objects.create_user(self.username, self.email, self.password)
+ foo = Foo.objects.create(name='Foo')
+ Bar.objects.create(foo=foo)
def tearDown(self):
self.client.logout()
@@ -25,6 +28,13 @@ class DropdownWithAuthTests(TestCase):
response = self.client.get('/')
self.assertContains(response, 'john')
+ def test_bug_2455_clone_request(self):
+ self.client.login(username=self.username, password=self.password)
+ json_response = self.client.get('/foo/1/?format=json')
+ self.assertEqual(json_response.status_code, 200)
+ browsable_api_response = self.client.get('/foo/1/')
+ self.assertEqual(browsable_api_response.status_code, 200)
+
def test_logout_shown_when_logged_in(self):
self.client.login(username=self.username, password=self.password)
response = self.client.get('/')