Mercurial > kallithea
annotate rhodecode/tests/functional/test_journal.py @ 2963:742d1b8ca263 beta
use str() on os.walk passing unicode can lead to UnicodeDecode errors when iterating
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 26 Oct 2012 00:26:20 +0200 |
parents | 8ecc6b8229a5 |
children | 25029d6f4b47 |
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 |
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 | 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 | 11 |
734
49eb69d78988
implemented user dashboards, and following system.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
12 # Test response... |
1021 | 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 | 14 |
1021 | 15 assert """<div class="journal_day">%s</div>""" % datetime.date.today() in response.body, 'no info about action journal day' |
875 | 16 |
17 def test_stop_following_repository(self): | |
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 | 21 # |
1749
8ecc6b8229a5
commit less models
Marcin Kuzminski <marcin@python-works.com>
parents:
1713
diff
changeset
|
22 # followings = self.Session.query(UserFollowing)\ |
875 | 23 # .filter(UserFollowing.user == usr)\ |
24 # .filter(UserFollowing.follows_repository == repo).all() | |
25 # | |
26 # assert len(followings) == 1, 'Not following any repository' | |
27 # | |
28 # response = self.app.post(url(controller='journal', | |
29 # action='toggle_following'), | |
30 # {'auth_token':get_token(session), | |
31 # 'follows_repo_id':repo.repo_id}) | |
32 | |
33 def test_start_following_repository(self): | |
34 self.log_user() | |
35 response = self.app.get(url(controller='journal', action='index'),) | |
36 | |
37 | |
38 def __add_repo(self): | |
39 pass | |
40 | |
41 def __remove_repo(self): | |
42 pass |