Example #1
0
 def test_split_subquery_domain_empty(self):
     """
     Test the split of domains in local and relation parts (empty domain)
     """
     local, related = split_subquery_domain([])
     self.assertEqual(local, [])
     self.assertEqual(related, [])
Example #2
0
 def test_split_subquery_domain_dotter(self):
     """
     Test the split of domains in local and relation parts (dotted domain)
     """
     local, related = split_subquery_domain([('a.b', '=', 1)])
     self.assertEqual(local, [])
     self.assertEqual(related, [('a.b', '=', 1)])
Example #3
0
 def test_split_subquery_domain_operator(self):
     """
     Test the split of domains in local and relation parts (with operator)
     """
     local, related = split_subquery_domain(
         ['OR', ('a', '=', 1), ('b.c', '=', 2)])
     self.assertEqual(local, [('a', '=', 1)])
     self.assertEqual(related, [('b.c', '=', 2)])
Example #4
0
 def test_split_subquery_domain_mixed(self):
     """
     Test the split of domains in local and relation parts (mixed domains)
     """
     local, related = split_subquery_domain([('a', '=', 1),
                                             ('b.c', '=', 2)])
     self.assertEqual(local, [('a', '=', 1)])
     self.assertEqual(related, [('b.c', '=', 2)])
Example #5
0
 def test_split_subquery_domain_nested(self):
     """
     Test the split of domains in local and relation parts (nested domains)
     """
     local, related = split_subquery_domain(
         [['AND', ('a', '=', 1), ('b', '=', 2)],
          ['AND', ('b', '=', 2), ['OR', ('c', '=', 3), ('d.e', '=', 4)]]])
     self.assertEqual(local, [['AND', ('a', '=', 1), ('b', '=', 2)]])
     self.assertEqual(
         related,
         [['AND', ('b', '=', 2), ['OR', ('c', '=', 3), ('d.e', '=', 4)]]])