Changeset - ec64c396da8c
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-05-11 23:24:08
marcin@python-works.com
added tests for gist expiration
1 file changed with 11 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/tests/functional/test_admin_gists.py
Show inline comments
 
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('<div class="ui-btn green badge">Public gist</div>')
 

	
 
    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'),
0 comments (0 inline, 0 general)