示例#1
0
 def setUp(self):
     self.query = DictQuery(
         foo="bar",
         empty="",
         none=None,
         upper="UPPERCASE",
         title="Title",
     )
示例#2
0
class TestDecoration(unittest.TestCase):
    def setUp(self):
        self.query = DictQuery(
            foo="bar",
            empty="",
            none=None,
            upper="UPPERCASE",
            title="Title",
        )

    def test_no_decorate(self):
        expected = {
            "foo": "bar",
            "empty": "",
            "none": None,
            "upper": "UPPERCASE",
            "title": "Title",
        }
        self.assertDictEqual(self.query.render(), expected)

    def test_decorate(self):
        expected = {"foo": "bar", "upper": "uppercase", "title": "title"}
        result = QueryEnhancer(self.query, remove_empty,
                               case_insensitive).render()
        self.assertDictEqual(result, expected)
class TestDecoration(unittest.TestCase):
    def setUp(self):
        self.query = DictQuery(
            foo="bar", empty="", none=None, upper="UPPERCASE", title="Title"
        )

    def test_no_decorate(self):
        expected = {
            "foo": "bar",
            "empty": "",
            "none": None,
            "upper": "UPPERCASE",
            "title": "Title",
        }
        self.assertDictEqual(self.query.render(), expected)

    def test_decorate(self):
        expected = {"foo": "bar", "upper": "uppercase", "title": "title"}
        result = QueryEnhancer(
            self.query, remove_empty, case_insensitive
        ).render()
        self.assertDictEqual(result, expected)
 def setUp(self):
     self.query = DictQuery(
         foo="bar", empty="", none=None, upper="UPPERCASE", title="Title"
     )