##// END OF EJS Templates
reverted copy of cached instance:...
reverted copy of cached instance: CPython changelog total_time 39.7253162861 average on req 0.993132907152 changesets total_time 42.5156304836 average on req 0.425156304836 Total: 546 MB changelog total_time 35.5851216316 average on req 0.889628040791 changesets total_time 30.3608012199 average on req 0.303608012199 Total: 475 MB

File last commit:

r1021:0ea8eca2 beta
r1340:cbdd583f beta
Show More
test_journal.py
42 lines | 1.6 KiB | text/x-python | PythonLexer
from rhodecode.tests import *
from rhodecode.model.db import UserFollowing, User, Repository
from rhodecode.lib.helpers import get_token
import datetime
class TestJournalController(TestController):
def test_index(self):
self.log_user()
response = self.app.get(url(controller='journal', action='index'))
# Test response...
assert """ <span id="follow_toggle_1" class="following" title="Stop following this repository""" in response.body, 'no info about stop follwoing repo id 1'
assert """<div class="journal_day">%s</div>""" % datetime.date.today() in response.body, 'no info about action journal day'
def test_stop_following_repository(self):
session = self.log_user()
# usr = self.sa.query(User).filter(User.username == 'test_admin').one()
# repo = self.sa.query(Repository).filter(Repository.repo_name == HG_REPO).one()
#
# followings = self.sa.query(UserFollowing)\
# .filter(UserFollowing.user == usr)\
# .filter(UserFollowing.follows_repository == repo).all()
#
# assert len(followings) == 1, 'Not following any repository'
#
# response = self.app.post(url(controller='journal',
# action='toggle_following'),
# {'auth_token':get_token(session),
# 'follows_repo_id':repo.repo_id})
def test_start_following_repository(self):
self.log_user()
response = self.app.get(url(controller='journal', action='index'),)
def __add_repo(self):
pass
def __remove_repo(self):
pass