<s> from tddspry . django import TestCase <EOL> from django . contrib . auth . models import User , check_password <EOL> from testproject . testapp . models import UserProfile <EOL> TEST_BIO = u'<STR_LIT>' <EOL> class TestBaseHelpers ( TestCase ) : <EOL> def test_create_profile ( self ) : <EOL> old_counter = UserProfile . objects . count ( ) <EOL> user = self . helper ( '<STR_LIT>' ) <EOL> profile = self . helper ( '<STR_LIT>' , <EOL> user , UserProfile , bio = TEST_BIO ) <EOL> new_counter = UserProfile . objects . count ( ) <EOL> self . assert_equal ( new_counter - <NUM_LIT:1> , old_counter ) <EOL> self . assert_equal ( profile . user , user ) <EOL> self . assert_equal ( profile . bio , TEST_BIO ) <EOL> def test_create_staff ( self ) : <EOL> old_counter = User . objects . count ( ) <EOL> user = self . helper ( '<STR_LIT>' ) <EOL> new_counter = User . objects . count ( ) <EOL> self . assert_equal ( new_counter - <NUM_LIT:1> , old_counter ) <EOL> self . assert_true ( user . is_staff ) <EOL> def test_create_superuser ( self ) : <EOL> old_counter = User . objects . count ( ) <EOL> user = self . helper ( '<STR_LIT>' ) <EOL> new_counter = User . objects . count ( ) <EOL> self . assert_equal ( new_counter - <NUM_LIT:1> , old_counter ) <EOL> self . assert_true ( user . is_staff ) <EOL> self . assert_true ( user . is_superuser ) <EOL> def test_create_user ( self ) : <EOL> old_counter = User . objects . count ( ) <EOL> user = self . helper ( '<STR_LIT>' ) <EOL> new_counter = User . objects . count ( ) <EOL> self . assert_equal ( new_counter - <NUM_LIT:1> , old_counter ) <EOL> self . assert_equal ( user . username , self . helpers . USERNAME ) <EOL> self . assert_true ( check_password ( self . helpers . PASSWORD , user . password ) ) <EOL> self . assert_equal ( user . email , self . helpers . EMAIL ) <EOL> self . assert_true ( user . is_active ) <EOL> self . assert_false ( user . is_staff ) <EOL> self . assert_false ( user . is_superuser ) <EOL> def test_create_user_raw ( self ) : <EOL> old_counter = User . objects . count ( ) <EOL> user = self . helper ( '<STR_LIT>' , raw = True ) <EOL> new_counter = User . objects . count ( ) <EOL> self . assert_equal ( new_counter - <NUM_LIT:1> , old_counter ) <EOL> self . assert_equal ( user . username , self . helpers . USERNAME ) <EOL> self . assert_equal ( user . password , self . helpers . PASSWORD ) <EOL> self . assert_equal ( user . email , self . helpers . EMAIL ) <EOL> self . assert_true ( user . is_active ) <EOL> self . assert_false ( user . is_staff ) <EOL> self . assert_false ( user . is_superuser ) <EOL> class TestRegistrationHelpers ( TestCase ) : <EOL> def test_registration ( self ) : <EOL> self . helper ( '<STR_LIT>' ) </s>
