示例#1
0
 def test_single_nested_list_values_default(self):
     value = SingleNestedListValue()
     with env(DJANGO_TEST='2,3;4,5'):
         expected = [['2', '3'], ['4', '5']]
         self.assertEqual(value.setup('TEST'), expected)
     with env(DJANGO_TEST='2;3;4;5'):
         expected = [['2'], ['3'], ['4'], ['5']]
         self.assertEqual(value.setup('TEST'), expected)
     with env(DJANGO_TEST='2,3,4,5'):
         expected = [['2', '3', '4', '5']]
         self.assertEqual(value.setup('TEST'), expected)
     with env(DJANGO_TEST='2, 3 , ; 4 , 5 ; '):
         expected = [['2', '3'], ['4', '5']]
         self.assertEqual(value.setup('TEST'), expected)
     with env(DJANGO_TEST=''):
         self.assertEqual(value.setup('TEST'), [])
示例#2
0
 def test_single_nested_list_values_default(self):
     value = SingleNestedListValue()
     with env(DJANGO_TEST='2,3;4,5'):
         expected = [['2', '3'], ['4', '5']]
         self.assertEqual(value.setup('TEST'), expected)
     with env(DJANGO_TEST='2;3;4;5'):
         expected = [['2'], ['3'], ['4'], ['5']]
         self.assertEqual(value.setup('TEST'), expected)
     with env(DJANGO_TEST='2,3,4,5'):
         expected = [['2', '3', '4', '5']]
         self.assertEqual(value.setup('TEST'), expected)
     with env(DJANGO_TEST='2, 3 , ; 4 , 5 ; '):
         expected = [['2', '3'], ['4', '5']]
         self.assertEqual(value.setup('TEST'), expected)
     with env(DJANGO_TEST=''):
         self.assertEqual(value.setup('TEST'), [])
示例#3
0
 def test_single_nested_list_values_converter(self):
     value = SingleNestedListValue(converter=int)
     with env(DJANGO_TEST='2,3;4,5'):
         self.assertEqual(value.setup('TEST'), [[2, 3], [4, 5]])
示例#4
0
 def test_single_nested_list_values_separator(self):
     value = SingleNestedListValue(seq_separator=':')
     with env(DJANGO_TEST='2,3:4,5'):
         self.assertEqual(value.setup('TEST'), [['2', '3'], ['4', '5']])
示例#5
0
 def test_single_nested_list_values_converter(self):
     value = SingleNestedListValue(converter=int)
     with env(DJANGO_TEST='2,3;4,5'):
         self.assertEqual(value.setup('TEST'), [[2, 3], [4, 5]])
示例#6
0
 def test_single_nested_list_values_separator(self):
     value = SingleNestedListValue(seq_separator=':')
     with env(DJANGO_TEST='2,3:4,5'):
         self.assertEqual(value.setup('TEST'), [['2', '3'], ['4', '5']])