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())
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]))
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())