diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py
index e264b6df77..20905bc124 100644
a
|
b
|
class OtherModelFormTests(TestCase):
|
2544 | 2544 | class ModelFormCustomErrorTests(SimpleTestCase): |
2545 | 2545 | def test_custom_error_messages(self): |
2546 | 2546 | data = {'name1': '@#$!!**@#$', 'name2': '@#$!!**@#$'} |
2547 | | errors = CustomErrorMessageForm(data).errors |
| 2547 | form1 = CustomErrorMessageForm(data) |
| 2548 | form2 = CustomErrorMessageForm(data) |
| 2549 | form2.fields['name1'].error_messages['invalid'] = 'new message for form2' |
| 2550 | errors = form1.errors |
2548 | 2551 | self.assertHTMLEqual( |
2549 | 2552 | str(errors['name1']), |
2550 | 2553 | '<ul class="errorlist"><li>Form custom error message.</li></ul>' |
… |
… |
class ModelFormCustomErrorTests(SimpleTestCase):
|
2553 | 2556 | str(errors['name2']), |
2554 | 2557 | '<ul class="errorlist"><li>Model custom error message.</li></ul>' |
2555 | 2558 | ) |
| 2559 | errors = form2.errors |
| 2560 | self.assertHTMLEqual( |
| 2561 | str(errors['name1']), |
| 2562 | '<ul class="errorlist"><li>new message for form2</li></ul>' |
| 2563 | ) |
| 2564 | self.assertHTMLEqual( |
| 2565 | str(errors['name2']), |
| 2566 | '<ul class="errorlist"><li>Model custom error message.</li></ul>' |
| 2567 | ) |
2556 | 2568 | |
2557 | 2569 | def test_model_clean_error_messages(self): |
2558 | 2570 | data = {'name1': 'FORBIDDEN_VALUE', 'name2': 'ABC'} |