annotate rhodecode/tests/functional/test_journal.py @ 3797:d7488551578e beta

synced vcs with upstream - moved subprocessio module to VCS - many small changes to make embedded vcs as similar to to external lib - use only absolute imports - patch vcs config during load pylons env
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 27 Apr 2013 11:24:25 +0200
parents 4910b2607a29
children 7e5f8c12a3fc
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
3075
25029d6f4b47 fixed issue with public journal rss/atom feeds after journal filter implementation
Marcin Kuzminski <marcin@python-works.com>
parents: 1749
diff changeset
6
734
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 class TestJournalController(TestController):
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9 def test_index(self):
875
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
10 self.log_user()
734
49eb69d78988 implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11 response = self.app.get(url(controller='journal', action='index'))
1021
0ea8eca2d63e fixed tests
Marcin Kuzminski <marcin@python-works.com>
parents: 875
diff changeset
12
3159
4910b2607a29 fixes issue #658, my account edit was missing this functionality
Marcin Kuzminski <marcin@python-works.com>
parents: 3075
diff changeset
13 response.mustcontain("""<div class="journal_day">%s</div>""" % datetime.date.today())
875
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
14
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
15 def test_stop_following_repository(self):
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
16 session = self.log_user()
3797
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3159
diff changeset
17 # usr = Session().query(User).filter(User.username == 'test_admin').one()
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3159
diff changeset
18 # repo = Session().query(Repository).filter(Repository.repo_name == HG_REPO).one()
875
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
19 #
3797
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3159
diff changeset
20 # followings = Session().query(UserFollowing)\
875
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
21 # .filter(UserFollowing.user == usr)\
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
22 # .filter(UserFollowing.follows_repository == repo).all()
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
23 #
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
24 # assert len(followings) == 1, 'Not following any repository'
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 # response = self.app.post(url(controller='journal',
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
27 # action='toggle_following'),
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
28 # {'auth_token':get_token(session),
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
29 # 'follows_repo_id':repo.repo_id})
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
30
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
31 def test_start_following_repository(self):
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
32 self.log_user()
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
33 response = self.app.get(url(controller='journal', action='index'),)
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
34
3075
25029d6f4b47 fixed issue with public journal rss/atom feeds after journal filter implementation
Marcin Kuzminski <marcin@python-works.com>
parents: 1749
diff changeset
35 def test_public_journal_atom(self):
25029d6f4b47 fixed issue with public journal rss/atom feeds after journal filter implementation
Marcin Kuzminski <marcin@python-works.com>
parents: 1749
diff changeset
36 self.log_user()
25029d6f4b47 fixed issue with public journal rss/atom feeds after journal filter implementation
Marcin Kuzminski <marcin@python-works.com>
parents: 1749
diff changeset
37 response = self.app.get(url(controller='journal', action='public_journal_atom'),)
875
0765fd5bf668 tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
38
3075
25029d6f4b47 fixed issue with public journal rss/atom feeds after journal filter implementation
Marcin Kuzminski <marcin@python-works.com>
parents: 1749
diff changeset
39 def test_public_journal_rss(self):
25029d6f4b47 fixed issue with public journal rss/atom feeds after journal filter implementation
Marcin Kuzminski <marcin@python-works.com>
parents: 1749
diff changeset
40 self.log_user()
25029d6f4b47 fixed issue with public journal rss/atom feeds after journal filter implementation
Marcin Kuzminski <marcin@python-works.com>
parents: 1749
diff changeset
41 response = self.app.get(url(controller='journal', action='public_journal_rss'),)