web/test/unittest_formfields.py
branchstable
changeset 3334 8d831c02da9a
parent 2091 a7ea618e5478
child 3369 7b88d12b4ee2
child 3535 106b95ec1144
equal deleted inserted replaced
3332:91cff87c368f 3334:8d831c02da9a
   126         self.assertEquals(description_format_field.initial(form), 'text/html')
   126         self.assertEquals(description_format_field.initial(form), 'text/html')
   127         self.execute('INSERT CWProperty X: X pkey "ui.default-text-format", X value "text/rest", X for_user U WHERE U login "admin"')
   127         self.execute('INSERT CWProperty X: X pkey "ui.default-text-format", X value "text/rest", X for_user U WHERE U login "admin"')
   128         self.commit()
   128         self.commit()
   129         self.assertEquals(description_format_field.initial(form), 'text/rest')
   129         self.assertEquals(description_format_field.initial(form), 'text/rest')
   130 
   130 
       
   131 
       
   132 class UtilsTC(TestCase):
       
   133     def test_vocab_sort(self):
       
   134         self.assertEquals(vocab_sort([('Z', 1), ('A', 2),
       
   135                                       ('Group 1', None), ('Y', 3), ('B', 4),
       
   136                                       ('Group 2', None), ('X', 5), ('C', 6)]),
       
   137                           [('A', 2), ('Z', 1),
       
   138                            ('Group 1', None), ('B', 4), ('Y', 3),
       
   139                            ('Group 2', None), ('C', 6), ('X', 5)]
       
   140                           )
       
   141 
   131 if __name__ == '__main__':
   142 if __name__ == '__main__':
   132     unittest_main()
   143     unittest_main()