コード例 #1
0
 def test_ne_json_2(self):
     with raises_if(self, self.db.provider.dialect == 'Oracle', TranslationError,
                    "Oracle does not support comparison of json structures: p.info['os'] != Json({})"):
         p = get(p for p in self.Product if p.info['os'] != Json({}))
         self.assertTrue(p)
         p = get(p for p in self.Product if p.info['os'] != {'type': 'iOS', 'version': '8'})
         self.assertFalse(p)
コード例 #2
0
ファイル: test_json.py プロジェクト: kociad/gym
 def test_equal_empty_list_2(self):
     with raises_if(
             self, db.provider.dialect == 'Oracle', TranslationError,
             "Oracle does not support comparison of json structures: p.info['colors'] == Json([])"
     ):
         p = get(p for p in Product if p.info['colors'] == Json([]))
         self.assertIsNone(p)
コード例 #3
0
 def test_ne_empty_list(self):
     with raises_if(
             self, self.db.provider.dialect == 'Oracle', TranslationError,
             "Oracle does not support comparison of json structures: p.info['colors'] != Json([])"
     ):
         p = get(p for p in self.Product if p.info['colors'] != Json([]))
         self.assertTrue(p)
コード例 #4
0
ファイル: test_json.py プロジェクト: kociad/gym
 def test_equal_list_4(self):
     colors = ['Gold', 'Silver', 'Space Gray']
     with raises_if(
             self, db.provider.dialect == 'Oracle', TranslationError,
             "Oracle does not support comparison of json structures: p.info['colors'] == Json(colors)"
     ):
         p = get(p for p in Product if p.info['colors'] == Json(colors))
         self.assertTrue(p)