Example #1
0
 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
Example #2
0
    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('/'))
Example #3
0
 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
Example #4
0
 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