def test_aislug_raises_error_on_empty_string(self): f = AISlugField() self.assertEqual('', f.clean('', None))
def test_aislug_with_choices_cleans_valid_choice(self): f = AISlugField(max_length=1, choices=[('a','A'), ('b','B')]) self.assertEqual('a', f.clean('a', None))