Code style

This commit is contained in:
Nik 2016-08-24 19:09:44 +03:00
parent 963cf95753
commit 7b7ef95004

View File

@ -217,22 +217,21 @@ class TestRouterGeneratedSchema(TestCase):
] ]
)) ))
post_action = ('custom_action_post', post_action = ('custom_action_post',
coreapi.Link( coreapi.Link(
url='/example/{pk}/custom_action/', url='/example/{pk}/custom_action/',
action='post', action='post',
encoding='application/json', encoding='application/json',
fields=[ fields=[
coreapi.Field('pk', required=True, location='path'), coreapi.Field('pk', required=True, location='path'),
coreapi.Field('c', required=True, location='form'), coreapi.Field('c', required=True, location='form'),
coreapi.Field('d', required=False, location='form'), coreapi.Field('d', required=False, location='form'),
] ]
)) ))
self.assertIn(put_action, response.data['example'].items()) self.assertIn(put_action, response.data['example'].items())
self.assertIn(post_action, response.data['example'].items()) self.assertIn(post_action, response.data['example'].items())
@unittest.skipUnless(coreapi, 'coreapi is not installed') @unittest.skipUnless(coreapi, 'coreapi is not installed')
class TestSchemaGenerator(TestCase): class TestSchemaGenerator(TestCase):
def test_view(self): def test_view(self):