very basic and unoptimized search functionality is working

This commit is contained in:
Sam
2021-02-04 10:19:38 +00:00
parent 77acc668b8
commit 904db3b794
2 changed files with 12 additions and 9 deletions

View File

@@ -356,6 +356,9 @@ class ProductSearchTest(TestCase):
self.user.save()
def test_anon_user_can_search(self):
self.factory(description="zapatos")
self.factory(tags="rojos")
query_string = quote("zapatos rojos")
url = f"{self.endpoint}?query_string={query_string}"
@@ -366,7 +369,7 @@ class ProductSearchTest(TestCase):
# check re sponse
self.assertEqual(response.status_code, 200)
# check for object creation
self.assertEquals(5, self.model.objects.count())
self.assertEquals(2, self.model.objects.count())
class MyProductsViewTest(APITestCase):