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'), ())
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))
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"), ())