Add a test to ensure that ordening and filtering works
Patch by: Sverre Rabbelier
--- a/tests/app/soc/logic/models/test_base.py Wed Mar 04 23:11:33 2009 +0000
+++ b/tests/app/soc/logic/models/test_base.py Wed Mar 04 23:26:11 2009 +0000
@@ -150,3 +150,15 @@
expected.reverse()
actual = [i.value for i in self.logic.getForFields(order=order)]
self.assertEqual(expected, actual)
+
+ def testGetFieldsFilteredOrdened(self):
+ """Test that fields can be filtered and ordened.
+ """
+
+ order = ['-value']
+
+ fields = {'value': [1,2, 3, 4]}
+
+ expected = [4, 3, 2, 1]
+ actual = [i.value for i in self.logic.getForFields(fields, order=order)]
+ self.assertEqual(expected, actual)