search optimization broken by tags

This commit is contained in:
Sam
2021-02-04 14:10:51 +00:00
parent 67ce92c33f
commit b9822edc8d
3 changed files with 28 additions and 14 deletions

View File

@@ -380,6 +380,7 @@ class ProductSearchTest(TestCase):
def test_anon_user_can_search(self):
self.factory(description="zapatos")
self.factory(tags="rojos")
# self.factory(tags="azul")
query_string = quote("zapatos rojos")
@@ -390,7 +391,8 @@ class ProductSearchTest(TestCase):
# check re sponse
self.assertEqual(response.status_code, 200)
# check for object creation
self.assertEquals(2, self.model.objects.count())
data = json.loads(response.data)
self.assertEquals(len(data), self.model.objects.count())
class MyProductsViewTest(APITestCase):