def test_slug_against_illegal_characters(self):
        data = {
            'slug': '',
            'host_1': Host.objects.all()[0].pk,
            'tags': Tag.objects.all(),
        }
        for slug in ['a/b', 'a b', 'a!b', 'a.b', 'a\\b', 'a?b']:
            with self.subTest(slug=slug):
                data['slug'] = slug
                f = EventForm(data)
                self.assertEqual(f.is_valid(), False)
                self.assertIn('slug', f.errors)

        # allow dashes in the slugs
        data['slug'] = 'a-b'
        f = EventForm(data)
        self.assertEqual(f.is_valid(), False)
        self.assertNotIn('slug', f.errors)
Regression test: disallow events with slugs with wrong characters.
dataset/ETHPy150Open swcarpentry/amy/workshops/test/test_event.py/TestEventViews.test_slug_against_illegal_characters