'The flatpage admin form correctly validates urls'

def test_flatpage_admin_form_url_validation(self):

    self.assertTrue(FlatpageForm(data=dict(url=u'/new_flatpage/', **self.form_data)).is_valid())
    self.assertTrue(FlatpageForm(data=dict(url=u'/some.special~chars/', **self.form_data)).is_valid())
    self.assertTrue(FlatpageForm(data=dict(url=u'/some.very_special~chars-here/', **self.form_data)).is_valid())
    self.assertFalse(FlatpageForm(data=dict(url=u'/a    space/', **self.form_data)).is_valid())
    self.assertFalse(FlatpageForm(data=dict(url=u'/a    %    char/', **self.form_data)).is_valid())
    self.assertFalse(FlatpageForm(data=dict(url=u'/a    !    char/', **self.form_data)).is_valid())
    self.assertFalse(FlatpageForm(data=dict(url=u'/a    &    char/', **self.form_data)).is_valid())
    self.assertFalse(FlatpageForm(data=dict(url=u'/a    ?    char/', **self.form_data)).is_valid())
