* 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'),
|
||||
('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>'
|
||||
|
||||
MANAGERS = ADMINS
|
||||
|
|
|
@ -53,6 +53,7 @@ class UrlTestCase(TestCase):
|
|||
for line in file:
|
||||
line = line.strip()
|
||||
if line and not line.startswith('#'):
|
||||
line = line.split("#", 1)[0]
|
||||
urlspec = line.split()
|
||||
if len(urlspec) == 2:
|
||||
codes, testurl = urlspec
|
||||
|
@ -94,7 +95,7 @@ class UrlTestCase(TestCase):
|
|||
|
||||
def doUrlsTest(self, lst):
|
||||
response_count = {}
|
||||
for codes, url in lst:
|
||||
for codes, url, master in lst:
|
||||
if "skip" in codes or "Skip" in codes:
|
||||
print "Skipping %s" % (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))
|
||||
|
||||
def testUrlsList(self):
|
||||
lst = [(tuple[0], tuple[1]) for tuple in self.testtuples]
|
||||
print "\nTest listed URLs:"
|
||||
self.doUrlsTest(lst)
|
||||
print "\nTesting specified URLs:"
|
||||
self.doUrlsTest(self.testtuples)
|
||||
|
||||
def testUrlsFallback(self):
|
||||
patterns = get_patterns(ietf.urls)
|
||||
|
@ -139,6 +139,11 @@ class UrlTestCase(TestCase):
|
|||
url = "/"+pattern[1:-1]
|
||||
# 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/"):
|
||||
lst.append((["200"], url))
|
||||
print "\nTest non-listed URLs:"
|
||||
lst.append((["200"], url, None))
|
||||
else:
|
||||
lst.append((["skip"], url, None))
|
||||
else:
|
||||
lst.append((["Skip"], url, None))
|
||||
|
||||
print "\nTesting non-listed URLs:"
|
||||
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'
|
||||
|
||||
|
|
Loading…
Reference in a new issue