Esempio n. 1
0
    def test_build_where_clause_quoted_value(self):
        where_clause = utils.build_choose_clause(choices=["val1", "Someone's Company"], field="field1")

        self.assertEqual(where_clause, "field1 in ('val1', 'Someone\\\'s Company')")
Esempio n. 2
0
    def test_build_where_clause_integers(self):
        where_clause = utils.build_choose_clause(choices=[1, 2], field="field1")

        self.assertEqual(where_clause, "field1 in (1, 2)")
Esempio n. 3
0
    def test_build_where_clause_strings(self):
        where_clause = utils.build_choose_clause(choices=["val1", "val2"], field="field1")

        self.assertEqual(where_clause, "field1 in ('val1', 'val2')")
Esempio n. 4
0
    def test_build_choose_clause_unicode_escaped(self):
        where_clause = utils.build_choose_clause(
            choices=[u"Test - & % $", u"Another's Test"], field="field1")

        self.assertEqual(where_clause,
                         "field1 in ('Test - & % $', 'Another\\\'s Test')")