Пример #1
0
 def test_tuple_values_default(self):
     value = TupleValue()
     with env(DJANGO_TEST='2,2'):
         self.assertEqual(value.setup('TEST'), ('2', '2'))
     with env(DJANGO_TEST='2, 2 ,'):
         self.assertEqual(value.setup('TEST'), ('2', '2'))
     with env(DJANGO_TEST=''):
         self.assertEqual(value.setup('TEST'), ())
Пример #2
0
    def test_tuple_value(self):
        value = TupleValue(None)
        self.assertEqual(value.default, ())
        self.assertEqual(value.value, ())

        value = TupleValue((1, 2))
        self.assertEqual(value.default, (1, 2))
        self.assertEqual(value.value, (1, 2))
Пример #3
0
 def test_tuple_values_default(self):
     value = TupleValue()
     with env(DJANGO_TEST='2,2'):
         self.assertEqual(value.setup('TEST'), ('2', '2'))
     with env(DJANGO_TEST='2, 2 ,'):
         self.assertEqual(value.setup('TEST'), ('2', '2'))
     with env(DJANGO_TEST=''):
         self.assertEqual(value.setup('TEST'), ())
Пример #4
0
 def test_tuple_values_default(self):
     value = TupleValue()
     with env(DJANGO_TEST="2,2"):
         self.assertEqual(value.setup("TEST"), ("2", "2"))
     with env(DJANGO_TEST="2, 2 ,"):
         self.assertEqual(value.setup("TEST"), ("2", "2"))
     with env(DJANGO_TEST=""):
         self.assertEqual(value.setup("TEST"), ())