33import debug
44debug .debug = True
55
6+ from django .conf import settings
7+
68from tastypie .test import ResourceTestCase
79from ietf .utils .test_data import make_test_data
810
@@ -32,10 +34,12 @@ def list_recursively(self, resource, format):
3234
3335 def test_json_api_explore (self ):
3436 make_test_data ()
35- self .list_recursively ('/api/' , format = 'json' )
37+ apitop = settings .RESTAPI_V1_URL_TOP
38+ self .list_recursively ('/%s/' % apitop , format = 'json' )
3639
3740 def test_xml_api_explore (self ):
38- self .assertValidXMLResponse (self .api_client .get ('/api/doc/' , format = 'xml' ))
41+ apitop = settings .RESTAPI_V1_URL_TOP
42+ self .assertValidXMLResponse (self .api_client .get ('/%s/doc/' % apitop , format = 'xml' ))
3943
4044 def test_json_doc_document (self ):
4145 """
@@ -44,7 +48,8 @@ def test_json_doc_document(self):
4448 than 100 documents in the test-data (the current count is 10)
4549 """
4650 make_test_data ()
47- r = self .api_client .get ('/api/doc/document/' , format = 'json' , limit = 100 )
51+ apitop = settings .RESTAPI_V1_URL_TOP
52+ r = self .api_client .get ('/%s/doc/document/' % apitop , format = 'json' , limit = 100 )
4853 doclist = self .deserialize (r )["objects" ]
4954 docs = dict ( (doc ["name" ], doc ) for doc in doclist )
5055 for name in (
@@ -63,11 +68,12 @@ def test_json_doc_relationships(self):
6368 of relationships give URLs which are handled without raising exceptions.
6469 """
6570 make_test_data ()
66- r = self .api_client .get ('/api/doc/document/' , format = 'json' )
71+ apitop = settings .RESTAPI_V1_URL_TOP
72+ r = self .api_client .get ('/%s/doc/document/' % apitop , format = 'json' )
6773 doclist = self .deserialize (r )["objects" ]
6874 for doc in doclist :
6975 for key in doc :
7076 value = doc [key ]
71- if isinstance (value , basestring ) and value .startswith ('/api/' ):
77+ if isinstance (value , basestring ) and value .startswith ('/%s/' % apitop ):
7278 self .api_client .get (value , format = 'json' )
7379
0 commit comments