Esempio n. 1
0
 def test_bad_input_raises_runtime_error(self):
     with self.assertRaises(RuntimeError):
         get_url('a', 'b', 'c', 'd')
Esempio n. 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]))
Esempio n. 3
0
 def test_url_from_simple_reverse_query(self):
     self.assertEqual('/people/', get_url('people:index'))
Esempio n. 4
0
 def test_url_from_model_instance(self):
     person = PersonFactory(id=987)
     self.assertEqual('/people/987/', get_url(person))
Esempio n. 5
0
 def test_url_from_string_with_special_characters(self):
     self.assertEqual('/ti%C3%ABsto/', get_url(u'/tiësto/'))
Esempio n. 6
0
 def test_url_from_string(self):
     self.assertEqual('/people/', get_url('/people/'))