Example #1
0
 def test_generate_url_path_format_suffix(self):
     url_path = generate_url_path("/path/to/{id}/{lang}/{format}/", format_suffix='json', lang='es')
     self.assertEqual("/path/to/{id}/es/{format}/.json", url_path)
Example #2
0
 def test_generate_url_path_multiples_missing_param(self):
     url_path = generate_url_path("/path/to/{id}/{lang}/{format}/", lang='es')
     self.assertEqual("/path/to/{id}/es/{format}/", url_path)
Example #3
0
 def test_generate_url_path_with_multiple_params(self):
     url_path = generate_url_path("/path/to/{id}/{lang}/", id=1, lang='es')
     self.assertEqual("/path/to/1/es/", url_path)
Example #4
0
 def test_generate_url_path_extra_param(self):
     url_path = generate_url_path("/path/to/{lang}/", lang='es', invented='hello')
     self.assertEqual("/path/to/es/", url_path)
Example #5
0
 def test_generate_url_path_with_prefix(self):
     url_path = generate_url_path("/path/to/{id}/", prefix="/example", id=1)
     self.assertEqual("/example/path/to/1/", url_path)