def test_filter_by_non_doc_fields(self): try: product.filter(None, { "disallow_new": False }) except Fault as f: self.assertEqual(f.faultCode, 400, AssertMessage.SHOULD_BE_400) else: self.fail(AssertMessage.NOT_VALIDATE_ARGS)
def test_filter_by_name(self): try: prod = product.filter(None, { "name": "StarCraft" }) except Fault: self.fail(AssertMessage.UNEXCEPT_ERROR) else: self.assertIsNotNone(prod) self.assertEqual(prod[0]['name'], "StarCraft")
def test_filter_by_name(self): prod = product.filter(None, {'name': 'Nitrate'}) self.assertIsNotNone(prod) self.assertEqual(prod[0]['name'], 'Nitrate')
def test_filter_by_id(self): prod = product.filter(None, {"id": self.product.pk}) self.assertIsNotNone(prod) self.assertEqual(prod[0]['name'], 'Nitrate')