#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# user_details = { #NEWLINE# #INDENT# 'username' : 'test_user@demo.com' , #NEWLINE# 'password' : 'test_pass' , #NEWLINE# 'email' : 'test_user@demo.com' , #NEWLINE# 'first_name' : 'Johnny' , #NEWLINE# 'last_name' : 'Energy' , #NEWLINE# #UNINDENT# } #NEWLINE# self . user = User . objects . create_user ( ** user_details ) #NEWLINE# self . org = Organization . objects . create ( name = 'my org' ) #NEWLINE# self . org . add_member ( self . user ) #NEWLINE# self . client . login ( ** user_details ) #NEWLINE# self . fake_request = FakeRequest ( user = self . user ) #NEWLINE# self . NUMBER_ACTIVE = 50 #NEWLINE# NUMBER_INACTIVE = 25 #NEWLINE# NUMBER_WITHOUT_CANONICAL = 5 #NEWLINE# for i in range ( cb . NUMBER_ACTIVE ) : #NEWLINE# #INDENT# cb = CanonicalBuilding ( active = True ) #NEWLINE# cb . save ( ) #NEWLINE# b = SEEDFactory . building_snapshot ( canonical_building = cb ) #NEWLINE# cb . canonical_snapshot = b #NEWLINE# cb . save ( ) #NEWLINE# b . super_organization = self . org #NEWLINE# b . save ( ) #NEWLINE# #UNINDENT# for i in range ( NUMBER_INACTIVE ) : #NEWLINE# #INDENT# cb = CanonicalBuilding ( active = False ) #NEWLINE# cb . save ( ) #NEWLINE# b = SEEDFactory . building_snapshot ( canonical_building = cb ) #NEWLINE# cb . canonical_snapshot = b #NEWLINE# cb . save ( ) #NEWLINE# b . super_organization = self . org #NEWLINE# b . save ( ) #NEWLINE# #UNINDENT# for i in range ( NUMBER_WITHOUT_CANONICAL ) : #NEWLINE# #INDENT# b = SEEDFactory . building_snapshot ( ) #NEWLINE# b . super_organization = self . org #NEWLINE# b . save ( )