def test_prefix_url(self): """ Check if `prefix_url` function correctly builds URLs, irrespective of whether the target URL is affixed with slashes or not. Edge cases tested by this method include empty strings and strings consisting of a single slash. """ bare_prefix = URL_PREFIX.strip('/') url = prefix_url('') self.assertEquals(url, '/{}/'.format(bare_prefix)) url = prefix_url('/') self.assertEquals(url, '/{}/'.format(bare_prefix)) url = prefix_url('foo') self.assertEquals(url, '/{}/foo/'.format(bare_prefix)) url = prefix_url('/foo') self.assertEquals(url, '/{}/foo/'.format(bare_prefix)) url = prefix_url('foo/') self.assertEquals(url, '/{}/foo/'.format(bare_prefix)) url = prefix_url('/foo/') self.assertEquals(url, '/{}/foo/'.format(bare_prefix))
ACCEPTED_FILE_TYPES = (".xml", ".zip") ENTITIES_PER_PAGE = 10 try: commit_log = check_output(["git", "log", "--pretty=oneline"]) # pylint: disable-msg=E1103 COMMIT_TAG = commit_log.split("\n")[0].split()[0] # pylint: disable-msg=W0703 except Exception, e: COMMIT_TAG = None from utils import prefix_url HOME_URL = prefix_url("/") LOGIN_URL = prefix_url("/login/") LOGIN_REDIRECT_URL = HOME_URL LOGOUT_URL = prefix_url("/logout/") FORCE_SCRIPT_NAME = "" DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', '*****@*****.**'), ) MANAGERS = ADMINS