Changeset 3900
- Timestamp:
- 01/12/08 17:18:42 (10 months ago)
- Files:
-
- branches/1.0/CHANGELOG.txt (modified) (2 diffs)
- branches/1.0/turbogears/identity/tests/test_visit.py (modified) (5 diffs)
- branches/1.0/turbogears/visit/api.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/CHANGELOG.txt
r3898 r3900 16 16 ~~~~~ 17 17 18 * Fixed the visit cookie which was never resent to client until 19 it expired(#1652). 18 20 * Fixed teardown for SQLObject tables (#1674). 19 21 * Fixed VisitFilter when Identity is on and there are list parameters (#1622). … … 26 28 ~~~~~~~~~~~~ 27 29 28 Florent Aide, Toshio Kuratomi, Jan ONDREJ (SAL), Matt Wilson, Christoph Zwerschke. 30 Florent Aide, Toshio Kuratomi, Jan ONDREJ (SAL), Martin Schwamberger (mschw), 31 Matt Wilson, Christoph Zwerschke. 29 32 30 33 branches/1.0/turbogears/identity/tests/test_visit.py
r3793 r3900 28 28 29 29 def tearDown(self): 30 turbogears.startup.stopTurboGears() 30 31 turbogears.config.update({'visit.timeout': self._visit_timeout}) 31 32 turbogears.config.update({'visit.on': self._visit_on}) … … 39 40 # the test still passes without it, but exceptions are thrown later 40 41 # once nose wants to quit. 41 turbogears.startup.stopTurboGears()42 42 43 43 def test_new_visit(self): … … 45 45 testutil.create_request("/") 46 46 assert turbogears.visit.current().is_new 47 turbogears.startup.stopTurboGears()48 47 49 48 def test_old_visit(self): … … 54 53 testutil.create_request("/", headers=cookie_header(morsel)) 55 54 assert not turbogears.visit.current().is_new 56 turbogears.startup.stopTurboGears()57 55 58 56 def test_cookie_expires(self): … … 68 66 assert turbogears.visit.current().is_new, \ 69 67 'this should be a new visit, as the cookie has expired' 70 turbogears.startup.stopTurboGears() 68 69 def test_cookie_re_sent(self): 70 "Test whether the visit cookie is re-sent with new expiry time." 71 testutil.create_request('/') 72 morsel = cherrypy.response.simple_cookie[self.cookie_name] 73 exp1 = time.strptime(morsel['expires'], '%a, %d-%b-%Y %H:%M:%S GMT') 74 # sleep one second to ensure that we get a new expiry time. 75 time.sleep(1) 76 headers = {'Cookie': morsel.output(header='')[1:]} 77 testutil.create_request('/', headers=headers) 78 assert self.cookie_name in cherrypy.response.simple_cookie 79 morsel = cherrypy.response.simple_cookie[self.cookie_name] 80 exp2 = time.strptime(morsel['expires'], '%a, %d-%b-%Y %H:%M:%S GMT') 81 assert exp1 < exp2 branches/1.0/turbogears/visit/api.py
r3841 r3900 230 230 visit_key = self._generate_key() 231 231 visit = _manager.new_visit_with_key(visit_key) 232 self.send_cookie(visit_key) 232 233 self.send_cookie(visit_key) 233 234 234 235 set_current(visit)