Example #1
0
 def test_bad_input_raises_runtime_error(self):
     with self.assertRaises(RuntimeError):
         get_url('a', 'b', 'c', 'd')
Example #2
0
 def test_url_from_complex_reverse_query(self):
     person = PersonFactory(id=789)
     self.assertEqual(
         '/people/789/', get_url('people:detail', args=[person.id]))
Example #3
0
 def test_url_from_simple_reverse_query(self):
     self.assertEqual('/people/', get_url('people:index'))
Example #4
0
 def test_url_from_model_instance(self):
     person = PersonFactory(id=987)
     self.assertEqual('/people/987/', get_url(person))
Example #5
0
 def test_url_from_string_with_special_characters(self):
     self.assertEqual('/ti%C3%ABsto/', get_url(u'/tiësto/'))
Example #6
0
 def test_url_from_string(self):
     self.assertEqual('/people/', get_url('/people/'))