[Zope3-checkins] CVS: Products3/z3checkins/tests - test_message.py:1.4

Marius Gedminas mgedmin@codeworks.lt
Thu, 3 Apr 2003 07:48:49 -0500


Update of /cvs-repository/Products3/z3checkins/tests
In directory cvs.zope.org:/tmp/cvs-serv30202/z3checkins/tests

Modified Files:
	test_message.py 
Log Message:
Links for next/previous 20 items in the sidebar.
Message headers are now wrapped.
Got rid of divs inside anchors, active link changes background.


=== Products3/z3checkins/tests/test_message.py 1.3 => 1.4 ===
--- Products3/z3checkins/tests/test_message.py:1.3	Thu Apr  3 07:08:24 2003
+++ Products3/z3checkins/tests/test_message.py	Thu Apr  3 07:48:48 2003
@@ -317,8 +317,10 @@
         view = ContainerView()
         view.context = { 'x': 123, 'y': object(), 'z': MessageStub(date=1),
                          'a': MessageStub(date=2), 'c': MessageStub(date=3) }
-        res = view.last_checkins()
+        view.request = {}
+        res = view.checkins()
         self.assertEquals(len(res), 3)
+        self.assertEquals(view.count(), 3)
         self.assertEquals(res[0].date, 3)
         self.assertEquals(res[1].date, 2)
         self.assertEquals(res[2].date, 1)
@@ -334,7 +336,8 @@
         view = ContainerView()
         view.context = { 'x': 123, 'y': object(), 'z': MessageStub(date=1),
                          'a': MessageStub(date=2), 'c': MessageStub(date=3) }
-        res = view.last_checkins(2)
+        view.request = {}
+        res = view.checkins(size=2)
         self.assertEquals(len(res), 2)
         self.assertEquals(res[0].date, 3)
         self.assertEquals(res[1].date, 2)
@@ -343,6 +346,14 @@
         self.assertEquals(getWrapperData(res[0])['name'], 'c')
         self.assertEquals(getWrapperData(res[1])['name'], 'a')
 
+        res = view.checkins(start=1, size=3)
+        self.assertEquals(len(res), 2)
+        self.assertEquals(res[0].date, 2)
+        self.assertEquals(res[1].date, 1)
+        self.assertEquals(getWrapperContext(res[0]), view.context)
+        self.assertEquals(getWrapperContext(res[1]), view.context)
+        self.assertEquals(getWrapperData(res[0])['name'], 'a')
+        self.assertEquals(getWrapperData(res[1])['name'], 'z')
 
 
 def diff(a, b):