Example #1
0
 def test_GET_406(self): 
     self.test_insert_anotation()
     graph = format_graphIRI('submitted')        
     request = self.factory.get('/endpoint', data = {'graph': graph}, 
                            HTTP_ACCEPT = 'fake')
     response = endpoint(request)
     self.assert_(response.status_code in [406], "HTTPResponse has status: %s" 
                  % response.status_code)
Example #2
0
    def test_PUT(self): 
        #self.test_insert_anotation()

        graph = format_graphIRI('submitted')
        request = self.factory.put('/endpoint?graph=%s' % graph, 
                                   data = turtle_usecase1,
                                   content_type = 'text/turtle')
        response = endpoint(request)
        self.assert_(response.status_code in [200, 204], "HTTPResponse has status_code: %s" 
                     % response.status_code)
Example #3
0
    def test_GET(self): 
        self.test_insert_anotation()

        graph = format_graphIRI('submitted')
        for accept in FORMAT_MAP.values():
            request = self.factory.get('/endpoint', data = {'graph': graph}, 
                                   HTTP_ACCEPT = accept)
            response = endpoint(request)
            self.assert_(response.status_code in [200, 204], "HTTPResponse has status: %s" 
                         % response.status_code)
            self.assert_('http://data.gov.uk//dataset/index-of-multiple-deprivation' 
                         in response.content, "Cannot serialize %s" % accept)