Esempio n. 1
0
 def list(self, request):
     qr = request.GET.get('q', '')
     queryset = search_function(qr)[:20]
     serializer = SearchV2Serializer(queryset, many=True)
     return Response(serializer.data)
Esempio n. 2
0
 def list(self, request):
     qr = request.GET.get('q', '')
     queryset = search_function(qr)[:20]
     serializer = SearchV2Serializer(queryset, many=True)
     return Response(serializer.data)
Esempio n. 3
0
 def test_search_function(self):
     build_1(False)
     results = search_function('ser')
     self.assertEquals(results[0].title, 'Serious Testing')
 def test_search_function(self):
     build_1(False)
     results = search_function('ser')
     self.assertEqual(results[0].title, 'Serious Testing')