* 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
This commit is contained in:
parent
027d471dd0
commit
f55e0b00f9
|
@ -17,6 +17,11 @@ ADMINS = (
|
||||||
('IETF Django Developers', 'django-project@ietf.org'),
|
('IETF Django Developers', 'django-project@ietf.org'),
|
||||||
('GMail Tracker Archive', 'ietf.tracker.archive+errors@gmail.com'),
|
('GMail Tracker Archive', 'ietf.tracker.archive+errors@gmail.com'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Override this in the settings_local.py file:
|
||||||
|
SERVER_EMAIL = 'Django Server<django@tools.ietf.org>'
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_FROM_EMAIL = 'IETF Secretariat <ietf-secretariat-reply@ietf.org>'
|
DEFAULT_FROM_EMAIL = 'IETF Secretariat <ietf-secretariat-reply@ietf.org>'
|
||||||
|
|
||||||
MANAGERS = ADMINS
|
MANAGERS = ADMINS
|
||||||
|
|
|
@ -53,6 +53,7 @@ class UrlTestCase(TestCase):
|
||||||
for line in file:
|
for line in file:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if line and not line.startswith('#'):
|
if line and not line.startswith('#'):
|
||||||
|
line = line.split("#", 1)[0]
|
||||||
urlspec = line.split()
|
urlspec = line.split()
|
||||||
if len(urlspec) == 2:
|
if len(urlspec) == 2:
|
||||||
codes, testurl = urlspec
|
codes, testurl = urlspec
|
||||||
|
@ -94,7 +95,7 @@ class UrlTestCase(TestCase):
|
||||||
|
|
||||||
def doUrlsTest(self, lst):
|
def doUrlsTest(self, lst):
|
||||||
response_count = {}
|
response_count = {}
|
||||||
for codes, url in lst:
|
for codes, url, master in lst:
|
||||||
if "skip" in codes or "Skip" in codes:
|
if "skip" in codes or "Skip" in codes:
|
||||||
print "Skipping %s" % (url)
|
print "Skipping %s" % (url)
|
||||||
elif url:
|
elif url:
|
||||||
|
@ -127,9 +128,8 @@ class UrlTestCase(TestCase):
|
||||||
self.assertEqual(ind, "OK", "Found %s cases of result code: %s" % (response_count[res], code))
|
self.assertEqual(ind, "OK", "Found %s cases of result code: %s" % (response_count[res], code))
|
||||||
|
|
||||||
def testUrlsList(self):
|
def testUrlsList(self):
|
||||||
lst = [(tuple[0], tuple[1]) for tuple in self.testtuples]
|
print "\nTesting specified URLs:"
|
||||||
print "\nTest listed URLs:"
|
self.doUrlsTest(self.testtuples)
|
||||||
self.doUrlsTest(lst)
|
|
||||||
|
|
||||||
def testUrlsFallback(self):
|
def testUrlsFallback(self):
|
||||||
patterns = get_patterns(ietf.urls)
|
patterns = get_patterns(ietf.urls)
|
||||||
|
@ -139,6 +139,11 @@ class UrlTestCase(TestCase):
|
||||||
url = "/"+pattern[1:-1]
|
url = "/"+pattern[1:-1]
|
||||||
# if there is no variable parts in the url, test it
|
# if there is no variable parts in the url, test it
|
||||||
if re.search("^[-a-z0-9./_]*$", url) and not url in self.testurls and not url.startswith("/admin/"):
|
if re.search("^[-a-z0-9./_]*$", url) and not url in self.testurls and not url.startswith("/admin/"):
|
||||||
lst.append((["200"], url))
|
lst.append((["200"], url, None))
|
||||||
print "\nTest non-listed URLs:"
|
else:
|
||||||
|
lst.append((["skip"], url, None))
|
||||||
|
else:
|
||||||
|
lst.append((["Skip"], url, None))
|
||||||
|
|
||||||
|
print "\nTesting non-listed URLs:"
|
||||||
self.doUrlsTest(lst)
|
self.doUrlsTest(lst)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
DEFAULT_FROM_EMAIL = 'Django IETFdb Test<django-test@tools.ietf.org>'
|
DEFAULT_FROM_EMAIL = 'Django IETFdb Test Server<django-test@tools.ietf.org>'
|
||||||
|
SERVER_EMAIL = 'Django IETFdb Test Server<django-test@tools.ietf.org>'
|
||||||
|
|
||||||
SERVER_MODE = 'test'
|
SERVER_MODE = 'test'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue