Mercurial > kallithea
annotate rhodecode/tests/functional/test_journal.py @ 3141:a45191e7c7bb beta
access control: fix owner checks - they were always true
The lambda expressions seems to be left over from something else. They were no
longer executed and thus always evaluated to true.
Some of the functions also failed if they were executed.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Wed, 02 Jan 2013 13:56:44 +0100 |
parents | 25029d6f4b47 |
children | 4910b2607a29 |
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 | 2 from rhodecode.model.db import UserFollowing, User, Repository |
3 from rhodecode.lib.helpers import get_token | |
1021 | 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 | 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 | 12 |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
13 # Test response... |
1021 | 14 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 | 15 |
1021 | 16 assert """<div class="journal_day">%s</div>""" % datetime.date.today() in response.body, 'no info about action journal day' |
875 | 17 |
18 def test_stop_following_repository(self): | |
19 session = self.log_user() | |
1749
8ecc6b8229a5
commit less models
Marcin Kuzminski <marcin@python-works.com>
parents:
1713
diff
changeset
|
20 # 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
|
21 # repo = self.Session.query(Repository).filter(Repository.repo_name == HG_REPO).one() |
875 | 22 # |
1749
8ecc6b8229a5
commit less models
Marcin Kuzminski <marcin@python-works.com>
parents:
1713
diff
changeset
|
23 # followings = self.Session.query(UserFollowing)\ |
875 | 24 # .filter(UserFollowing.user == usr)\ |
25 # .filter(UserFollowing.follows_repository == repo).all() | |
26 # | |
27 # assert len(followings) == 1, 'Not following any repository' | |
28 # | |
29 # response = self.app.post(url(controller='journal', | |
30 # action='toggle_following'), | |
31 # {'auth_token':get_token(session), | |
32 # 'follows_repo_id':repo.repo_id}) | |
33 | |
34 def test_start_following_repository(self): | |
35 self.log_user() | |
36 response = self.app.get(url(controller='journal', action='index'),) | |
37 | |
3075
25029d6f4b47
fixed issue with public journal rss/atom feeds after journal filter implementation
Marcin Kuzminski <marcin@python-works.com>
parents:
1749
diff
changeset
|
38 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
|
39 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
|
40 response = self.app.get(url(controller='journal', action='public_journal_atom'),) |
875 | 41 |
3075
25029d6f4b47
fixed issue with public journal rss/atom feeds after journal filter implementation
Marcin Kuzminski <marcin@python-works.com>
parents:
1749
diff
changeset
|
42 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
|
43 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
|
44 response = self.app.get(url(controller='journal', action='public_journal_rss'),) |