Пример #1
0
    def test_setting_forms(self):
        c = ChoicesSetting.get('test')

        self.assertTrue('<select' in c.form())

        h = HTMLSetting.get('test')
        self.assertTrue('<textarea' in h.form())

        b = BoolSetting.get('test')
        self.assertTrue('checkbox' in b.form())

        c.choices = zip(range(3), range(3))
        self.assertTrue('value="0"' in c.form())
Пример #2
0
    def test_setting_forms(self):
        c = ChoicesSetting.get("test")

        self.assertTrue("<select" in c.form())

        h = HTMLSetting.get("test")
        self.assertTrue("<textarea" in h.form())

        b = BoolSetting.get("test")
        self.assertTrue("checkbox" in b.form())

        c.choices = zip(range(3), range(3))
        self.assertTrue('value="0"' in c.form())
Пример #3
0
    def test_setting_type(self):
        a = BoolSetting.get('test-name')  # automatically created

        self.assertTrue(a)
        self.assertIsInstance(a, Setting)
        self.assertIsInstance(a, BoolSetting)

        self.assertEqual(type(a.get_value()), bool)

        b = HTMLSetting.get('test2')
        self.assertIsInstance(b, HTMLSetting)

        c = ChoicesSetting.get('test3')
        self.assertIsInstance(c, ChoicesSetting)