def test_update_set_add(self): us = UpdateStatement('table') us.add_update(Set(Text, db_field='a'), set((1, )), 'add') self.assertEqual(six.text_type(us), 'UPDATE table SET "a" = "a" + %(0)s')
def test_update_empty_set_removal_does_not_assign(self): us = UpdateStatement('table') us.add_update(Set(Text, db_field='a'), set(), 'remove') self.assertFalse(us.assignments)
def test_update_empty_set_removal_does_not_assign(self): us = UpdateStatement("table") us.add_update(Set(Text, db_field="a"), set(), "remove") self.assertFalse(us.assignments)