Ejemplo n.º 1
0
 def test_instance_criteria_tuples(self):
     specimen = MyModel(
         y='y1',
         z=('z1', 'z2'),
     )
     self.assertEqual(
         "my_table.y = :y_1 AND my_table.z IN (:z_1, :z_2)",
         str(update_match.manufacture_entity_criteria(specimen).compile()))
Ejemplo n.º 2
0
 def test_instance_criteria_none_list(self):
     specimen = MyModel(
         y='y1',
         z=[None],
     )
     self.assertEqual(
         "my_table.y = :y_1 AND my_table.z IS NULL",
         str(update_match.manufacture_entity_criteria(specimen).compile()))
Ejemplo n.º 3
0
 def test_instance_criteria_basic_wnone(self):
     specimen = MyModel(y='y1',
                        z=None,
                        uuid='136254d5-3869-408f-9da7-190e0072641a')
     self.assertEqual(
         "my_table.uuid = :uuid_1 AND my_table.y = :y_1 "
         "AND my_table.z IS NULL",
         str(update_match.manufacture_entity_criteria(specimen).compile()))
Ejemplo n.º 4
0
 def test_instance_criteria_none_list(self):
     specimen = MyModel(
         y='y1', z=[None],
     )
     self.assertEqual(
         "my_table.y = :y_1 AND my_table.z IS NULL",
         str(update_match.manufacture_entity_criteria(specimen).compile())
     )
Ejemplo n.º 5
0
 def test_instance_criteria_tuples(self):
     specimen = MyModel(
         y='y1', z=('z1', 'z2'),
     )
     self.assertEqual(
         "my_table.y = :y_1 AND my_table.z IN (:z_1, :z_2)",
         str(update_match.manufacture_entity_criteria(specimen).compile())
     )
Ejemplo n.º 6
0
 def test_instance_criteria_tuples(self):
     specimen = MyModel(
         y='y1',
         z=('z1', 'z2'),
     )
     self.assertRegex(
         str(update_match.manufacture_entity_criteria(specimen).compile()),
         r"my_table.y = :y_1 AND my_table.z IN \(.+?\)",
     )
Ejemplo n.º 7
0
 def test_instance_criteria_basic_wnone(self):
     specimen = MyModel(
         y='y1', z=None,
         uuid='136254d5-3869-408f-9da7-190e0072641a'
     )
     self.assertEqual(
         "my_table.uuid = :uuid_1 AND my_table.y = :y_1 "
         "AND my_table.z IS NULL",
         str(update_match.manufacture_entity_criteria(specimen).compile())
     )