Skip to content

Commit 5186592

Browse files
Add functional test for citations pages
The problem in LMFDB#2332 went unnoticed because of a lack of testing. This commit adds tests for the base citations page and the "How to Cite" the lmfdb page. These tests really just check that these pages exist. It also tests a specific reference in the citation list and tests for its bib entry in the associated bibliography list. This would catch the problem from LMFDB#2332. Note that I've also submitted a pull request to the LMFDB/citations repository to prevent this issue from coming up. This is LMFDB/citations#9
1 parent af4f714 commit 5186592

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

lmfdb/test_citations.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- coding: utf-8 -*-
2+
from lmfdb.base import LmfdbTest
3+
4+
5+
class CitationTest(LmfdbTest):
6+
'''
7+
Test that the citations page exists and the associated bib page exists
8+
'''
9+
10+
def test_citation_root(self):
11+
'''
12+
Checking /citation page
13+
'''
14+
r = self.tc.get('/citation')
15+
assert "A list of articles which cite the LMFDB" in r.data
16+
17+
def test_how_to_cite(self):
18+
'''
19+
Checking "How to Cite" /citation/citing
20+
'''
21+
r = self.tc.get('/citation/citing')
22+
assert "The BibTeX entry is" in r.data
23+
assert "To cite a specific page in the LMFDB" in r.data
24+
25+
def test_citation_specific(self):
26+
'''
27+
Checking that a known citation appears in /citation/citations list
28+
'''
29+
r = self.tc.get('/citation/citations')
30+
assert "Thomas A Hulse" in r.data
31+
assert "Counting square discriminants" in r.data
32+
33+
def test_cite_bib(self):
34+
'''
35+
Checking that a known bib is in /citation/citations_bib bibliography
36+
'''
37+
r = self.tc.get('/citation/citations_bib')
38+
assert "Hulse, Thomas A" in r.data
39+
assert "Counting square discriminants" in r.data

0 commit comments

Comments
 (0)