##// END OF EJS Templates
fixed tests
marcink -
r1021:0ea8eca2 beta
parent child Browse files
Show More
@@ -7,11 +7,13 b' class TestChangelogController(TestContro'
7 response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO))
7 response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO))
8
8
9 assert """<div id="chg_20" class="container">""" in response.body, 'wrong info about number of changes'
9 assert """<div id="chg_20" class="container">""" in response.body, 'wrong info about number of changes'
10 assert """<div class="date">commit 154: 5e204e7583b9@2010-08-10 01:18:46</div>""" in response.body , 'no info on this commit'
10 assert """<input class="changeset_range" id="5e204e7583b9" name="5e204e7583b9" type="checkbox" value="1" />""" in response.body, 'no checkbox for this commit'
11 assert """<span>commit 154: 5e204e7583b9@2010-08-10 01:18:46</span>""" in response.body , 'no info on this commit'
11 assert """Small update at simplevcs app""" in response.body, 'missing info about commit message'
12 assert """Small update at simplevcs app""" in response.body, 'missing info about commit message'
12 assert """<span class="removed tooltip" title="removed: No Files">0</span>""" in response.body, 'wrong info about removed nodes'
13
13 assert """<span class="changed tooltip" title="changed: vcs/backends/hg.py<br/> vcs/web/simplevcs/models.py">2</span>""" in response.body, 'wrong info about changed nodes'
14 assert """<span class="removed tooltip" title="<b>removed</b>: No Files">0</span>""" in response.body, 'wrong info about removed nodes'
14 assert """<span class="added tooltip" title="added: vcs/web/simplevcs/managers.py">1</span>""" in response.body, 'wrong info about added nodes'
15 assert """<span class="changed tooltip" title="<b>changed</b>: <br/> vcs/backends/hg.py<br/> vcs/web/simplevcs/models.py">2</span>""" in response.body, 'wrong info about changed nodes'
16 assert """<span class="added tooltip" title="<b>added</b>: <br/> vcs/web/simplevcs/managers.py">1</span>""" in response.body, 'wrong info about added nodes'
15
17
16 #pagination
18 #pagination
17
19
@@ -22,11 +24,14 b' class TestChangelogController(TestContro'
22 response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':5})
24 response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':5})
23 response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':6})
25 response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':6})
24
26
27
25 # Test response after pagination...
28 # Test response after pagination...
26 assert """<div class="date">commit 64: 46ad32a4f974@2010-04-20 00:33:21</div>"""in response.body, 'wrong info about commit 64'
29 print response.body
27 assert """<span class="removed tooltip" title="removed: docs/api.rst">1</span>"""in response.body, 'wrong info about number of removed'
30 assert """<input class="changeset_range" id="46ad32a4f974" name="46ad32a4f974" type="checkbox" value="1" />""" in response.body, 'no checkbox for this commit'
28 assert """<span class="changed tooltip" title="changed: .hgignore<br/> README.rst<br/> docs/conf.py<br/> docs/index.rst<br/> setup.py<br/> tests/test_hg.py<br/> tests/test_nodes.py<br/> vcs/__init__.py<br/> vcs/backends/__init__.py<br/> vcs/backends/base.py<br/> vcs/backends/hg.py<br/> vcs/nodes.py<br/> vcs/utils/__init__.py">13</span>"""in response.body, 'wrong info about number of changes'
31 assert """<span>commit 64: 46ad32a4f974@2010-04-20 00:33:21</span>"""in response.body, 'wrong info about commit 64'
29 assert """<span class="added tooltip" title="added: docs/api/backends/hg.rst<br/> docs/api/backends/index.rst<br/> docs/api/index.rst<br/> docs/api/nodes.rst<br/> docs/api/web/index.rst<br/> docs/api/web/simplevcs.rst<br/> docs/installation.rst<br/> docs/quickstart.rst<br/> setup.cfg<br/> vcs/utils/baseui_config.py<br/> vcs/utils/web.py<br/> vcs/web/__init__.py<br/> vcs/web/exceptions.py<br/> vcs/web/simplevcs/__init__.py<br/> vcs/web/simplevcs/exceptions.py<br/> vcs/web/simplevcs/middleware.py<br/> vcs/web/simplevcs/models.py<br/> vcs/web/simplevcs/settings.py<br/> vcs/web/simplevcs/utils.py<br/> vcs/web/simplevcs/views.py">20</span>"""in response.body, 'wrong info about number of added'
32 assert """<span class="removed tooltip" title="<b>removed</b>: <br/> docs/api.rst">1</span>"""in response.body, 'wrong info about number of removed'
33 assert """<span class="changed tooltip" title="<b>changed</b>: <br/> .hgignore<br/> README.rst<br/> docs/conf.py<br/> docs/index.rst<br/> setup.py<br/> tests/test_hg.py<br/> tests/test_nodes.py<br/> vcs/__init__.py<br/> vcs/backends/__init__.py<br/> vcs/backends/base.py<br/> vcs/backends/hg.py<br/> vcs/nodes.py<br/> vcs/utils/__init__.py">13</span>"""in response.body, 'wrong info about number of changes'
34 assert """<span class="added tooltip" title="<b>added</b>: <br/> docs/api/backends/hg.rst<br/> docs/api/backends/index.rst<br/> docs/api/index.rst<br/> docs/api/nodes.rst<br/> docs/api/web/index.rst<br/> docs/api/web/simplevcs.rst<br/> docs/installation.rst<br/> docs/quickstart.rst<br/> setup.cfg<br/> vcs/utils/baseui_config.py<br/> vcs/utils/web.py<br/> vcs/web/__init__.py<br/> vcs/web/exceptions.py<br/> vcs/web/simplevcs/__init__.py<br/> vcs/web/simplevcs/exceptions.py<br/> vcs/web/simplevcs/middleware.py<br/> vcs/web/simplevcs/models.py<br/> vcs/web/simplevcs/settings.py<br/> vcs/web/simplevcs/utils.py<br/> vcs/web/simplevcs/views.py">20</span>"""in response.body, 'wrong info about number of added'
30 assert """<div class="message"><a href="/%s/changeset/46ad32a4f974e45472a898c6b0acb600320579b1">Merge with 2e6a2bf9356ca56df08807f4ad86d480da72a8f4</a></div>""" % HG_REPO in response.body, 'wrong info about commit 64 is a merge'
35 assert """<div class="message"><a href="/%s/changeset/46ad32a4f974e45472a898c6b0acb600320579b1">Merge with 2e6a2bf9356ca56df08807f4ad86d480da72a8f4</a></div>""" % HG_REPO in response.body, 'wrong info about commit 64 is a merge'
31
36
32
37
@@ -1,23 +1,18 b''
1 from rhodecode.tests import *
1 from rhodecode.tests import *
2 from rhodecode.model.db import UserFollowing, User, Repository
2 from rhodecode.model.db import UserFollowing, User, Repository
3 from rhodecode.lib.helpers import get_token
3 from rhodecode.lib.helpers import get_token
4 import datetime
4
5
5 class TestJournalController(TestController):
6 class TestJournalController(TestController):
6
7
7 def test_index(self):
8 def test_index(self):
8 self.log_user()
9 self.log_user()
9 response = self.app.get(url(controller='journal', action='index'))
10 response = self.app.get(url(controller='journal', action='index'))
11
10 # Test response...
12 # Test response...
11 assert """<div class="currently_following">
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'
12
13
14 <img class="icon" title="public repository" alt="public repository" src="/images/icons/lock_open.png"/>
15
16 <a href="/vcs_test_hg/summary">vcs_test_hg</a>
17
18 </div>""" in response.body, 'following repo list'
19
14
20
15 assert """<div class="journal_day">%s</div>""" % datetime.date.today() in response.body, 'no info about action journal day'
21
16
22 def test_stop_following_repository(self):
17 def test_stop_following_repository(self):
23 session = self.log_user()
18 session = self.log_user()
@@ -127,7 +127,10 b' class TestLoginController(TestController'
127 print response.body
127 print response.body
128 assert response.status == '200 OK', 'Wrong response from register page got %s' % response.status
128 assert response.status == '200 OK', 'Wrong response from register page got %s' % response.status
129 assert 'An email address must contain a single @' in response.body
129 assert 'An email address must contain a single @' in response.body
130 assert 'Username may only contain alphanumeric characters underscores or dashes and must begin with alphanumeric character' in response.body
130 assert ('Username may only contain '
131 'alphanumeric characters underscores, '
132 'periods or dashes and must begin with '
133 'alphanumeric character') in response.body
131
134
132 def test_register_err_case_sensitive(self):
135 def test_register_err_case_sensitive(self):
133 response = self.app.post(url(controller='login', action='register'),
136 response = self.app.post(url(controller='login', action='register'),
General Comments 0
You need to be logged in to leave comments. Login now