annotate rhodecode/tests/functional/test_journal.py @ 3015:16af24982e30 beta

Multiple changes for compare system - count number of changed lines and files - add combined compare button into the old per changeset compare - fixed some logic for remote & bundle compare system - added few tests for git compare
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 18 Nov 2012 23:17:02 +0100
parents 8ecc6b8229a5
children 25029d6f4b47
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
734
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 from rhodecode.tests import *
875
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
2 from rhodecode.model.db import UserFollowing, User, Repository
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
3 from rhodecode.lib.helpers import get_token
1021
0ea8eca2d63e fixed tests
Marcin Kuzminski <marcin@python-works.com>
parents: 875
diff changeset
4 import datetime
734
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6 class TestJournalController(TestController):
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 def test_index(self):
875
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
9 self.log_user()
734
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 response = self.app.get(url(controller='journal', action='index'))
1021
0ea8eca2d63e fixed tests
Marcin Kuzminski <marcin@python-works.com>
parents: 875
diff changeset
11
734
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12 # Test response...
1021
0ea8eca2d63e fixed tests
Marcin Kuzminski <marcin@python-works.com>
parents: 875
diff changeset
13 assert """ <span id="follow_toggle_1" class="following" title="Stop following this repository""" in response.body, 'no info about stop follwoing repo id 1'
875
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
14
1021
0ea8eca2d63e fixed tests
Marcin Kuzminski <marcin@python-works.com>
parents: 875
diff changeset
15 assert """<div class="journal_day">%s</div>""" % datetime.date.today() in response.body, 'no info about action journal day'
875
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
16
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
17 def test_stop_following_repository(self):
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
18 session = self.log_user()
1749
8ecc6b8229a5 commit less models
Marcin Kuzminski <marcin@python-works.com>
parents: 1713
diff changeset
19 # usr = self.Session.query(User).filter(User.username == 'test_admin').one()
8ecc6b8229a5 commit less models
Marcin Kuzminski <marcin@python-works.com>
parents: 1713
diff changeset
20 # repo = self.Session.query(Repository).filter(Repository.repo_name == HG_REPO).one()
875
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
21 #
1749
8ecc6b8229a5 commit less models
Marcin Kuzminski <marcin@python-works.com>
parents: 1713
diff changeset
22 # followings = self.Session.query(UserFollowing)\
875
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
23 # .filter(UserFollowing.user == usr)\
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
24 # .filter(UserFollowing.follows_repository == repo).all()
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
25 #
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
26 # assert len(followings) == 1, 'Not following any repository'
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
27 #
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
28 # response = self.app.post(url(controller='journal',
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
29 # action='toggle_following'),
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
30 # {'auth_token':get_token(session),
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
31 # 'follows_repo_id':repo.repo_id})
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
32
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
33 def test_start_following_repository(self):
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
34 self.log_user()
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
35 response = self.app.get(url(controller='journal', action='index'),)
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
36
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
37
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
38 def __add_repo(self):
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
39 pass
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
40
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
41 def __remove_repo(self):
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
42 pass