Skip to content

Commit 3e39053

Browse files
committed
Test :lastactivity special variable for lastUserActivity()
1 parent 054cb02 commit 3e39053

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/test_actions.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from __future__ import print_function
2-
import unittest
2+
import unittest, copy
33
from cgi import FieldStorage, MiniFieldStorage
44

55
from roundup import hyperdb
@@ -242,10 +242,21 @@ def setUp(self):
242242
def testLastUserActivity(self):
243243
self.assertEqual(self.action.lastUserActivity(), None)
244244

245+
# copy corm value. Once we apend to it we can't delete
246+
# anything so save a copy for the second test case.
247+
base_form = copy.copy(self.client.form.value)
248+
249+
# test @ special variable form
245250
self.client.form.value.append(
246251
MiniFieldStorage('@lastactivity', str(self.now)))
247252
self.assertEqual(self.action.lastUserActivity(), self.now)
248253

254+
# test : special variable form
255+
self.client.form.value = base_form
256+
self.client.form.value.append(
257+
MiniFieldStorage(':lastactivity', str(self.now)))
258+
self.assertEqual(self.action.lastUserActivity(), self.now)
259+
249260
def testLastNodeActivity(self):
250261
self.action.classname = 'issue'
251262
self.action.nodeid = '1'

0 commit comments

Comments
 (0)