web/test/unittest_formfields.py
changeset 3369 7b88d12b4ee2
parent 2773 b2530e3e0afb
parent 3334 8d831c02da9a
child 3536 f6c9a5df80fb
--- a/web/test/unittest_formfields.py	Thu Sep 17 15:52:46 2009 +0200
+++ b/web/test/unittest_formfields.py	Tue Sep 22 12:11:12 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()