def _parsed_query(self, query_string): """Return the parsed query string from a handler_url generated with the supplied query_string""" return urlparse( handler_url(self.course_id, self.block, 'handler', query=query_string)).query
def test_trailing_characters(self): self.assertFalse(handler_url(self.course_id, self.block, 'handler').endswith('?')) self.assertFalse(handler_url(self.course_id, self.block, 'handler').endswith('/')) self.assertFalse(handler_url(self.course_id, self.block, 'handler', 'suffix').endswith('?')) self.assertFalse(handler_url(self.course_id, self.block, 'handler', 'suffix').endswith('/')) self.assertFalse(handler_url(self.course_id, self.block, 'handler', 'suffix', 'query').endswith('?')) self.assertFalse(handler_url(self.course_id, self.block, 'handler', 'suffix', 'query').endswith('/')) self.assertFalse(handler_url(self.course_id, self.block, 'handler', query='query').endswith('?')) self.assertFalse(handler_url(self.course_id, self.block, 'handler', query='query').endswith('/'))
def _parsed_path(self, handler_name='handler', suffix=''): """Return the parsed path from a handler_url with the supplied handler_name and suffix""" return urlparse(handler_url(self.course_id, self.block, handler_name, suffix=suffix)).path
def _parsed_query(self, query_string): """Return the parsed query string from a handler_url generated with the supplied query_string""" return urlparse(handler_url(self.course_id, self.block, 'handler', query=query_string)).query