<s> from django . test import TestCase <EOL> from comments . forms import SiteForm <EOL> class SiteTestCase ( TestCase ) : <EOL> pass <EOL> class SiteFormTestCase ( TestCase ) : <EOL> def test_form_validation_success ( self ) : <EOL> domain = '<STR_LIT>' <EOL> form = SiteForm ( data = { '<STR_LIT>' : domain } ) <EOL> if form . is_valid ( ) : <EOL> site = form . save ( ) <EOL> self . assertEqual ( site . domain , domain ) <EOL> def test_url_contains_protocol_success ( self ) : <EOL> domain = '<STR_LIT>' <EOL> form = SiteForm ( data = { '<STR_LIT>' : domain } ) <EOL> if form . is_valid ( ) : <EOL> site = form . save ( ) <EOL> self . assertEqual ( site . domain , "<STR_LIT>" ) <EOL> def test_wrong_url_no_success ( self ) : <EOL> domain = '<STR_LIT>' <EOL> form = SiteForm ( data = { '<STR_LIT>' : domain } ) <EOL> self . assertFalse ( form . is_valid ( ) ) </s>
