def test_discard_persistent_error_can_be_called_many_times(self): error_message = factory.make_string() component = get_random_component() register_persistent_error(component, error_message) discard_persistent_error(component) discard_persistent_error(component) self.assertItemsEqual([], get_persistent_errors())
def test_discard_persistent_error_can_be_called_many_times(self): error_message = factory.getRandomString() component = get_random_component() register_persistent_error(component, error_message) discard_persistent_error(component) discard_persistent_error(component) self.assertItemsEqual([], get_persistent_errors())
def test_register_persistent_error_stores_last_error(self): error_message = factory.make_string() error_message2 = factory.make_string() component = get_random_component() register_persistent_error(component, error_message) register_persistent_error(component, error_message2) self.assertItemsEqual([error_message2], get_persistent_errors())
def test_register_persistent_error_stores_last_error(self): error_message = factory.getRandomString() error_message2 = factory.getRandomString() component = get_random_component() register_persistent_error(component, error_message) register_persistent_error(component, error_message2) self.assertItemsEqual( [error_message2], get_persistent_errors())
def get_persistent_errors_returns_text_for_error_codes(self): errors, components = [], [] for _ in range(3): error_message = factory.make_string() component = get_random_component() register_persistent_error(component, error_message) errors.append(error_message) components.append(component) self.assertItemsEqual(errors, get_persistent_errors())
def get_persistent_errors_returns_text_for_error_codes(self): errors, components = [], [] for i in range(3): error_message = factory.getRandomString() component = get_random_component() register_persistent_error(component, error_message) errors.append(error_message) components.append(component) self.assertItemsEqual(errors, get_persistent_errors())
def global_options(context): return { 'persistent_errors': get_persistent_errors(), 'node_form': get_node_edit_form(context.user)(), 'POWER_TYPE_PARAMETERS_FIELDS': [(power_type, field.widget.render('power_parameters', [])) for power_type, field in POWER_TYPE_PARAMETERS.items() if power_type is not POWER_TYPE.DEFAULT], 'global_options': { 'site_name': Config.objects.get_config('maas_name'), } }
def global_options(context): return { 'persistent_errors': get_persistent_errors(), 'node_form': get_node_edit_form(context.user)(), 'POWER_TYPE_PARAMETERS_FIELDS': [(power_type, field.widget.render('power_parameters', [])) for power_type, field in POWER_TYPE_PARAMETERS.items() if power_type is not POWER_TYPE.DEFAULT], 'global_options': { 'site_name': Config.objects.get_config('maas_name'), } }
def test_discard_persistent_error_discards_error(self): error_message = factory.getRandomString() component = get_random_component() register_persistent_error(component, error_message) discard_persistent_error(component) self.assertItemsEqual([], get_persistent_errors())