From 7c6db6976ca925319f17887161923d753d178fbd Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 15 Feb 2021 12:17:54 +0000 Subject: [PATCH] improvements to product search test --- products/tests.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/products/tests.py b/products/tests.py index bfd73d5..0c79054 100644 --- a/products/tests.py +++ b/products/tests.py @@ -461,10 +461,11 @@ class ProductSearchTest(TestCase): def test_anon_user_can_search(self): expected_instances = [ - self.factory(description="zapatos verdes"), - self.factory(tags="colores/rojos, "), - self.factory(description="zapatos rojos"), - self.factory(attributes='"lunares rojos", '), + self.factory(tags="lunares/blancos",description="zapatos verdes"), + self.factory(tags="colores/rojos, tono/brillante"), + self.factory(tags="lunares/azules", description="zapatos rojos"), + self.factory(tags="lunares/rojos", description="zapatos"), + self.factory(attributes='"zapatos de campo", tono/oscuro'), ] unexpected_instances = [ self.factory(description="chanclas"), @@ -483,6 +484,8 @@ class ProductSearchTest(TestCase): self.assertEquals(len(payload['products']), len(expected_instances)) # check for filters self.assertNotEquals([], payload['filters']['singles']) + self.assertTrue(len(payload['filters']) >= 2 ) + import ipdb; ipdb.set_trace() class MyProductsViewTest(APITestCase):