PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/modeltests/validation/test_custom_messages.py

https://code.google.com/p/mango-py/
Python | 13 lines | 9 code | 4 blank | 0 comment | 0 complexity | 9b33edba904fcb323ce5fb4a639d5d9d MD5 | raw file
 1from modeltests.validation import ValidationTestCase
 2from models import CustomMessagesModel
 3
 4
 5class CustomMessagesTest(ValidationTestCase):
 6    def test_custom_simple_validator_message(self):
 7        cmm = CustomMessagesModel(number=12)
 8        self.assertFieldFailsValidationWithMessage(cmm.full_clean, 'number', ['AAARGH'])
 9
10    def test_custom_null_message(self):
11        cmm = CustomMessagesModel()
12        self.assertFieldFailsValidationWithMessage(cmm.full_clean, 'number', ['NULL'])
13