def test_query_with_prev_and_next_args_with_sort_by_and_lang(self, mock_get_schema):
     handler = MockHandler(querystring="page=2&per_page=1&sort_by=rdfs:label&lang=en")
     params = ParamDict(handler, context_name="subject", class_name="Maths", **(LIST_PARAMS))
     items = []
     computed = build_json(items, params)
     self.assertQueryStringArgsEqual(computed["_previous_args"], 'per_page=1&page=1&sort_by=rdfs%3Alabel&lang=en')
     self.assertQueryStringArgsEqual(computed["_next_args"], 'per_page=1&page=3&sort_by=rdfs%3Alabel&lang=en')
Exemplo n.º 2
0
 def test_query_with_extras(self, mock_get_schema):
     handler = MockHandler(querystring="class_prefix=Xubiru")
     params = ParamDict(handler,
                        context_name="zoo",
                        class_name="Lion",
                        **(LIST_PARAMS))
     items = []
     something = build_json(items, params)
     self.assertEqual(something["@context"], {'@language': 'pt'})
     self.assertEqual(something["items"], [])