|
a/Allura/allura/tests/functional/test_home.py |
|
b/Allura/allura/tests/functional/test_home.py |
1 |
import json
|
1 |
import json
|
|
|
2 |
import re
|
2 |
|
3 |
|
3 |
from allura.tests import TestController
|
4 |
from allura.tests import TestController
|
4 |
from allura.tests import decorators as td
|
5 |
from allura.tests import decorators as td
|
5 |
from allura import model as M
|
6 |
from allura import model as M
|
6 |
|
7 |
|
|
... |
|
... |
9 |
|
10 |
|
10 |
@td.with_wiki
|
11 |
@td.with_wiki
|
11 |
def test_project_nav(self):
|
12 |
def test_project_nav(self):
|
12 |
response = self.app.get('/p/test/_nav.json')
|
13 |
response = self.app.get('/p/test/_nav.json')
|
13 |
root = self.app.get('/p/test/wiki/').follow()
|
14 |
root = self.app.get('/p/test/wiki/').follow()
|
|
|
15 |
assert re.search(r'<!-- Server: \S+ -->', str(root.html)), 'Missing Server comment'
|
14 |
nav_links = root.html.find('div', dict(id='top_nav')).findAll('a')
|
16 |
nav_links = root.html.find('div', dict(id='top_nav')).findAll('a')
|
15 |
assert len(nav_links) == len(response.json['menu'])
|
17 |
assert len(nav_links) == len(response.json['menu'])
|
16 |
for nl, entry in zip(nav_links, response.json['menu']):
|
18 |
for nl, entry in zip(nav_links, response.json['menu']):
|
17 |
assert nl['href'] == entry['url']
|
19 |
assert nl['href'] == entry['url']
|
18 |
|
20 |
|