def test_new_format_second_default(self): class NewCaseGenerator(BasePayloadGenerator): format_name = 'rubbish' format_label = 'XML' def get_payload(self, repeat_record, payload_doc): return self.payload with self.assertRaises(DuplicateFormatException): RegisterGenerator.get_collection(CaseRepeater).add_new_format(NewCaseGenerator, is_default=True)
def setUpClass(cls): super(IgnoreDocumentTest, cls).setUpClass() class NewFormGenerator(BasePayloadGenerator): format_name = 'new_format' format_label = 'XML' def get_payload(self, repeat_record, payload_doc): raise IgnoreDocument RegisterGenerator.get_collection(FormRepeater).add_new_format(NewFormGenerator)
def setUpClass(cls): super(TestRepeaterFormat, cls).setUpClass() cls.payload = 'some random case' class NewCaseGenerator(BasePayloadGenerator): format_name = 'new_format' format_label = 'XML' deprecated_format_names = ('new_format_alias',) def get_payload(self, repeat_record, payload_doc): return cls.payload RegisterGenerator.get_collection(CaseRepeater).add_new_format(NewCaseGenerator) cls.new_generator = NewCaseGenerator