Skip to content

Commit f55e0b0

Browse files
committed
* Adding a SERVER_EMAIL setting in settings.py and settings_local_test.py
* Adding the ability to take trailing comments in testurl.list files * Listing skipped (not tested) urls in the URL test - Legacy-Id: 262
1 parent 027d471 commit f55e0b0

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

ietf/settings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
('IETF Django Developers', 'django-project@ietf.org'),
1818
('GMail Tracker Archive', 'ietf.tracker.archive+errors@gmail.com'),
1919
)
20+
21+
# Override this in the settings_local.py file:
22+
SERVER_EMAIL = 'Django Server<django@tools.ietf.org>'
23+
24+
2025
DEFAULT_FROM_EMAIL = 'IETF Secretariat <ietf-secretariat-reply@ietf.org>'
2126

2227
MANAGERS = ADMINS

ietf/tests.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def setUp(self):
5353
for line in file:
5454
line = line.strip()
5555
if line and not line.startswith('#'):
56+
line = line.split("#", 1)[0]
5657
urlspec = line.split()
5758
if len(urlspec) == 2:
5859
codes, testurl = urlspec
@@ -94,7 +95,7 @@ def testCoverage(self):
9495

9596
def doUrlsTest(self, lst):
9697
response_count = {}
97-
for codes, url in lst:
98+
for codes, url, master in lst:
9899
if "skip" in codes or "Skip" in codes:
99100
print "Skipping %s" % (url)
100101
elif url:
@@ -127,9 +128,8 @@ def doUrlsTest(self, lst):
127128
self.assertEqual(ind, "OK", "Found %s cases of result code: %s" % (response_count[res], code))
128129

129130
def testUrlsList(self):
130-
lst = [(tuple[0], tuple[1]) for tuple in self.testtuples]
131-
print "\nTest listed URLs:"
132-
self.doUrlsTest(lst)
131+
print "\nTesting specified URLs:"
132+
self.doUrlsTest(self.testtuples)
133133

134134
def testUrlsFallback(self):
135135
patterns = get_patterns(ietf.urls)
@@ -139,6 +139,11 @@ def testUrlsFallback(self):
139139
url = "/"+pattern[1:-1]
140140
# if there is no variable parts in the url, test it
141141
if re.search("^[-a-z0-9./_]*$", url) and not url in self.testurls and not url.startswith("/admin/"):
142-
lst.append((["200"], url))
143-
print "\nTest non-listed URLs:"
142+
lst.append((["200"], url, None))
143+
else:
144+
lst.append((["skip"], url, None))
145+
else:
146+
lst.append((["Skip"], url, None))
147+
148+
print "\nTesting non-listed URLs:"
144149
self.doUrlsTest(lst)

test/settings_local_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
DEFAULT_FROM_EMAIL = 'Django IETFdb Test<django-test@tools.ietf.org>'
1+
DEFAULT_FROM_EMAIL = 'Django IETFdb Test Server<django-test@tools.ietf.org>'
2+
SERVER_EMAIL = 'Django IETFdb Test Server<django-test@tools.ietf.org>'
23

34
SERVER_MODE = 'test'
45

0 commit comments

Comments
 (0)