def test_factory_registration(self): factory.register(TestMail) self.assertIn('test', factory.mail_map) factory.unregister(TestMail) self.assertNotIn('test', factory.mail_map)
def tearDown(self): factory.unregister(TestMail)
def test_factory_unregister(self): with self.assertRaises(MailFactoryError): factory.unregister(TestMail)