Exemple #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)
Exemple #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")
Exemple #3
0
 def test_filter_by_name(self):
     prod = product.filter(None, {'name': 'Nitrate'})
     self.assertIsNotNone(prod)
     self.assertEqual(prod[0]['name'], 'Nitrate')
Exemple #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')
Exemple #5
0
 def test_filter_by_name(self):
     prod = product.filter(None, {'name': 'Nitrate'})
     self.assertIsNotNone(prod)
     self.assertEqual(prod[0]['name'], 'Nitrate')
Exemple #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')