<s> """<STR_LIT>""" <EOL> from django . test import TestCase <EOL> from superperms . orgs . models import Organization <EOL> from landing . models import SEEDUser as User <EOL> from seed . tests . util import FakeRequest <EOL> from contacts . models import get_contact_types , Contact , ENERGY_AUDITOR <EOL> class ContactsViewTests ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> user_details = { <EOL> '<STR_LIT:username>' : '<STR_LIT>' , <EOL> '<STR_LIT:password>' : '<STR_LIT>' , <EOL> '<STR_LIT:email>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> self . user = User . objects . create_user ( ** user_details ) <EOL> self . org = Organization . objects . create ( name = '<STR_LIT>' ) <EOL> self . org . add_member ( self . user ) <EOL> self . client . login ( ** user_details ) <EOL> self . fake_request = FakeRequest ( user = self . user ) <EOL> def test_get_contact_types ( self ) : <EOL> types = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> self . assertEqual ( get_contact_types ( ) , types ) <EOL> def test_model ( self ) : <EOL> c = Contact . objects . create ( <EOL> contact_type = ENERGY_AUDITOR , <EOL> company = '<STR_LIT>' , <EOL> name = '<STR_LIT>' , <EOL> street_address = '<STR_LIT>' , <EOL> city = '<STR_LIT>' , <EOL> postal_code = '<STR_LIT>' , <EOL> state = '<STR_LIT>' , <EOL> email_address = '<STR_LIT>' , <EOL> telephone_number = '<STR_LIT>' , <EOL> super_organization = self . org , <EOL> ) <EOL> contact = Contact . objects . get ( pk = c . pk ) <EOL> self . assertEqual ( contact . name , '<STR_LIT>' ) <EOL> self . assertEqual ( self . org . contacts . first ( ) , contact ) <EOL> self . assertEqual ( <EOL> '<STR_LIT>' % contact . pk , <EOL> str ( contact ) <EOL> ) </s>
