def test_get_get_subrecord_from_api_name(self): hatwearer_api_name = HatWearer.get_api_name() famous_api_name = FamousLastWords.get_api_name() self.assertEqual( HatWearer, subrecords.get_subrecord_from_api_name(hatwearer_api_name)) self.assertEqual( FamousLastWords, subrecords.get_subrecord_from_api_name(famous_api_name))
def test_register_subrecords(self, subrecords, register): subrecords.return_value = [HatWearer] api.register_subrecords() self.assertEqual(register.call_count, 1) self.assertTrue(register.call_args[0][0][0], HatWearer.get_api_name())
def test_register_subrecords(self, subrecords, register): subrecords.return_value = [HatWearer] api.register_subrecords() self.assertEqual(register.call_count, 1) self.assertTrue(register.call_args[0][0][0], HatWearer.get_api_name())