@@ -44,16 +44,14 @@ def test_manage_domain(self):
4444 body = {'domain' : 'test-domain.example.com' }
4545 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' )
4646 self .assertEqual (response .status_code , 201 )
47-
4847 url = '/api/apps/{app_id}/domains' .format (app_id = self .app_id )
4948 response = self .client .get (url , content_type = 'application/json' )
5049 result = response .data ['results' ][0 ]
5150 self .assertEqual ('test-domain.example.com' , result ['domain' ])
52-
53- url = '/api/domains/{hostname}' . format ( hostname = 'test-domain.example.com' )
51+ url = '/api/apps/{app_id}/domains/{hostname}' . format ( hostname = 'test-domain.example.com' ,
52+ app_id = self . app_id )
5453 response = self .client .delete (url , content_type = 'application/json' )
5554 self .assertEqual (response .status_code , 204 )
56-
5755 url = '/api/apps/{app_id}/domains' .format (app_id = self .app_id )
5856 response = self .client .get (url , content_type = 'application/json' )
5957 self .assertEqual (0 , response .data ['count' ])
@@ -63,7 +61,6 @@ def test_manage_domain_invalid_app(self):
6361 body = {'domain' : 'test-domain.example.com' }
6462 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' )
6563 self .assertEqual (response .status_code , 404 )
66-
6764 url = '/api/apps/{app_id}/domains' .format (app_id = 'this-app-does-not-exist' )
6865 response = self .client .get (url , content_type = 'application/json' )
6966 self .assertEqual (response .status_code , 404 )
@@ -82,12 +79,10 @@ def test_manage_domain_invalid_domain(self):
8279 body = {'domain' : 'this_is_an.invalid.domain' }
8380 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' )
8481 self .assertEqual (response .status_code , 400 )
85-
8682 url = '/api/apps/{app_id}/domains' .format (app_id = self .app_id )
8783 body = {'domain' : 'this-is-an.invalid.a' }
8884 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' )
8985 self .assertEqual (response .status_code , 400 )
90-
9186 url = '/api/apps/{app_id}/domains' .format (app_id = self .app_id )
9287 body = {'domain' : 'domain' }
9388 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' )
0 commit comments