<s> import os <EOL> from django . core . files import File <EOL> from django . test import TestCase <EOL> from leads . models import Register , Newsletter <EOL> class TestRegisterModel ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . obj = Register . objects . create ( name = '<STR_LIT>' , email = '<STR_LIT>' ) <EOL> def test_str ( self ) : <EOL> self . assertEqual ( str ( self . obj ) , '<STR_LIT>' ) <EOL> class TestNewsletterModel ( TestCase ) : <EOL> def setUp ( self ) : <EOL> with open ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) ) as f : <EOL> self . obj = Newsletter . objects . create ( subject = '<STR_LIT>' , <EOL> from_name = '<STR_LIT>' , <EOL> from_address = '<STR_LIT>' , <EOL> html_file = File ( f ) ) <EOL> def test_str ( self ) : <EOL> self . assertEqual ( str ( self . obj ) , '<STR_LIT>' ) <EOL> def test_delete ( self ) : <EOL> self . obj . delete ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , Newsletter . objects . all ( ) . count ( ) ) </s>
