web/test/unittest_formfields.py
branchstable
changeset 3334 8d831c02da9a
parent 2091 a7ea618e5478
child 3369 7b88d12b4ee2
child 3535 106b95ec1144
--- a/web/test/unittest_formfields.py	Fri Sep 18 19:51:45 2009 +0200
+++ b/web/test/unittest_formfields.py	Mon Sep 21 11:41:17 2009 +0200
@@ -128,5 +128,16 @@
         self.commit()
         self.assertEquals(description_format_field.initial(form), 'text/rest')
 
+
+class UtilsTC(TestCase):
+    def test_vocab_sort(self):
+        self.assertEquals(vocab_sort([('Z', 1), ('A', 2),
+                                      ('Group 1', None), ('Y', 3), ('B', 4),
+                                      ('Group 2', None), ('X', 5), ('C', 6)]),
+                          [('A', 2), ('Z', 1),
+                           ('Group 1', None), ('B', 4), ('Y', 3),
+                           ('Group 2', None), ('C', 6), ('X', 5)]
+                          )
+
 if __name__ == '__main__':
     unittest_main()