示例#1
0
 def test_set_values_default(self):
     value = SetValue()
     with env(DJANGO_TEST='2,2'):
         self.assertEqual(value.setup('TEST'), set(['2', '2']))
     with env(DJANGO_TEST='2, 2 ,'):
         self.assertEqual(value.setup('TEST'), set(['2', '2']))
     with env(DJANGO_TEST=''):
         self.assertEqual(value.setup('TEST'), set())
示例#2
0
    def test_set_value(self):
        value = SetValue()
        self.assertEqual(value.default, set())
        self.assertEqual(value.value, set())

        value = SetValue([1, 2])
        self.assertEqual(value.default, set([1, 2]))
        self.assertEqual(value.value, set([1, 2]))
示例#3
0
 def test_set_values_default(self):
     value = SetValue()
     with env(DJANGO_TEST='2,2'):
         self.assertEqual(value.setup('TEST'), set(['2', '2']))
     with env(DJANGO_TEST='2, 2 ,'):
         self.assertEqual(value.setup('TEST'), set(['2', '2']))
     with env(DJANGO_TEST=''):
         self.assertEqual(value.setup('TEST'), set())
示例#4
0
 def test_set_values_default(self):
     value = SetValue()
     with env(DJANGO_TEST="2,2"):
         self.assertEqual(value.setup("TEST"), set(["2", "2"]))
     with env(DJANGO_TEST="2, 2 ,"):
         self.assertEqual(value.setup("TEST"), set(["2", "2"]))
     with env(DJANGO_TEST=""):
         self.assertEqual(value.setup("TEST"), set())