# HG changeset patch # User Marcin Kuzminski # Date 2013-05-11 23:24:08 # Node ID ec64c396da8c9597bcfc5ac053e42b5c84f8c720 # Parent ad4a680113b74caf2481963d50b8a4bd899df228 added tests for gist expiration diff --git a/rhodecode/tests/functional/test_admin_gists.py b/rhodecode/tests/functional/test_admin_gists.py --- a/rhodecode/tests/functional/test_admin_gists.py +++ b/rhodecode/tests/functional/test_admin_gists.py @@ -1,3 +1,5 @@ +import datetime + from rhodecode.tests import * from rhodecode.model.gist import GistModel from rhodecode.model.meta import Session @@ -73,6 +75,15 @@ class TestGistsController(TestController response.mustcontain('gist test') response.mustcontain('
Public gist
') + def test_access_expired_gist(self): + self.log_user() + gist = _create_gist('never-see-me') + gist.gist_expires = 0 # 1970 + Session().add(gist) + Session().commit() + + response = self.app.get(url('gist', id=gist.gist_access_id), status=404) + def test_create_private(self): self.log_user() response = self.app.post(url('gists'),