<s> from __future__ import unicode_literals <EOL> from django import forms <EOL> from django . test import TestCase <EOL> from . models import UUIDPK <EOL> class UUIDPKForm ( forms . ModelForm ) : <EOL> class Meta : <EOL> model = UUIDPK <EOL> fields = '<STR_LIT>' <EOL> class ModelFormBaseTest ( TestCase ) : <EOL> def test_create_save_error ( self ) : <EOL> form = UUIDPKForm ( { } ) <EOL> self . assertFalse ( form . is_valid ( ) ) <EOL> msg = "<STR_LIT>" <EOL> with self . assertRaisesMessage ( ValueError , msg ) : <EOL> form . save ( ) <EOL> def test_update_save_error ( self ) : <EOL> obj = UUIDPK . objects . create ( name = '<STR_LIT:foo>' ) <EOL> form = UUIDPKForm ( { } , instance = obj ) <EOL> self . assertFalse ( form . is_valid ( ) ) <EOL> msg = "<STR_LIT>" <EOL> with self . assertRaisesMessage ( ValueError , msg ) : <EOL> form . save ( ) </s>
