Mercurial > kallithea
changeset 6487:481f64dbe85c
tests: tighten TestHomeController matching/description
'<span class="repotag">git' does not actually appear in JS, so move it
above the comment saying so. For the rest, tighten the checks to
actually ensure they match JS, and not e.g. the same text in plain
HTML elsewhere on the page.
author | Søren Løvborg <sorenl@unity3d.com> |
---|---|
date | Fri, 10 Feb 2017 20:30:44 +0100 |
parents | c592865cea8d |
children | 9ee5e055514e |
files | kallithea/tests/functional/test_home.py |
diffstat | 1 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/tests/functional/test_home.py Thu Feb 02 03:16:14 2017 +0100 +++ b/kallithea/tests/functional/test_home.py Fri Feb 10 20:30:44 2017 +0100 @@ -16,18 +16,20 @@ response = self.app.get(url(controller='home', action='index')) #if global permission is set response.mustcontain('Add Repository') + + response.mustcontain('<span class="repotag">git') + # html in javascript variable: response.mustcontain('var data = {"totalRecords": %s' % Repository.query().count()) response.mustcontain(r'href=\"/%s\"' % HG_REPO) - response.mustcontain(r'<span class="repotag">git') response.mustcontain(r'<i class=\"icon-globe\"') - response.mustcontain("""fixes issue with having custom format for git-log""") - response.mustcontain("""/%s/changeset/5f2c6ee195929b0be80749243c18121c9864a3b3""" % GIT_REPO) + response.mustcontain(r'\"fixes issue with having custom format for git-log\n\"') + response.mustcontain(r'\"/%s/changeset/5f2c6ee195929b0be80749243c18121c9864a3b3\"' % GIT_REPO) - response.mustcontain("""disable security checks on hg clone for travis""") - response.mustcontain("""/%s/changeset/96507bd11ecc815ebc6270fdf6db110928c09c1e""" % HG_REPO) + response.mustcontain(r'\"disable security checks on hg clone for travis\"') + response.mustcontain(r'\"/%s/changeset/96507bd11ecc815ebc6270fdf6db110928c09c1e\"' % HG_REPO) def test_repo_summary_with_anonymous_access_disabled(self): with fixture.anon_access(False):