very basic and unoptimized search functionality is working
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user