Esempio n. 1
0
 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)
Esempio n. 2
0
 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")
Esempio n. 3
0
 def test_filter_by_name(self):
     prod = product.filter(None, {'name': 'Nitrate'})
     self.assertIsNotNone(prod)
     self.assertEqual(prod[0]['name'], 'Nitrate')
Esempio n. 4
0
 def test_filter_by_id(self):
     prod = product.filter(None, {"id": self.product.pk})
     self.assertIsNotNone(prod)
     self.assertEqual(prod[0]['name'], 'Nitrate')
Esempio n. 5
0
 def test_filter_by_name(self):
     prod = product.filter(None, {'name': 'Nitrate'})
     self.assertIsNotNone(prod)
     self.assertEqual(prod[0]['name'], 'Nitrate')
Esempio n. 6
0
 def test_filter_by_id(self):
     prod = product.filter(None, {"id": self.product.pk})
     self.assertIsNotNone(prod)
     self.assertEqual(prod[0]['name'], 'Nitrate')