#NEWLINE# def test_request_accepted_new_person_added( self ) : #NEWLINE# #INDENT# 'Ensure new person is added when no-one matches the profile update\n        request.' #NEWLINE# Person . objects . exclude ( username = 'admin' ) . delete ( ) #NEWLINE# self . assertEqual ( Person . objects . count ( ) , 1 ) #NEWLINE# pr = ProfileUpdateRequest . objects . create ( active = True , personal = 'Warry' , family = 'Trotter' , email = 'warry@trotter.com' , affiliation = 'Auror at Ministry of Magic' , airport_iata = 'AAA' , occupation = '' , occupation_other = 'Auror' , github = 'hpotter' , twitter = 'hpotter' , orcid = '0000-1111' , website = 'http://warry.trotter.com/' , gender = 'M' ) #NEWLINE# ( pr . domains . add ( * KnowledgeDomain . objects . all ( ) [ 0 : 2 ] ) , ) #NEWLINE# ( pr . lessons . add ( * Lesson . objects . all ( ) [ 0 : 2 ] ) , ) #NEWLINE# rv = self . client . get ( reverse ( 'profileupdaterequest_accept' , args = [ pr . pk ] ) ) #NEWLINE# self . assertEqual ( rv . status_code , 302 , rv . status_code ) #NEWLINE# self . assertEqual ( Person . objects . count ( ) , 2 ) #NEWLINE# person = Person . objects . get ( personal = 'Warry' , family = 'Trotter' ) #NEWLINE# self . assertEqual ( person . personal , 'Warry' ) #NEWLINE# self . assertEqual ( person . family , 'Trotter' ) #NEWLINE# self . assertEqual ( person . email , 'warry@trotter.com' ) #NEWLINE# self . assertEqual ( pr . affiliation , 'Auror at Ministry of Magic' ) #NEWLINE# self . assertEqual ( person . airport . iata , 'AAA' ) #NEWLINE# self . assertEqual ( person . github , 'hpotter' ) #NEWLINE# self . assertEqual ( person . twitter , 'hpotter' ) #NEWLINE# self . assertEqual ( person . url , 'http://warry.trotter.com/' ) #NEWLINE# self . assertEqual ( person . gender , 'M' ) #NEWLINE# self . assertEqual ( person . occupation , 'Auror' ) #NEWLINE# self . assertEqual ( person . orcid , '0000-1111' ) #NEWLINE# self . assertEqual ( set ( person . domains . all ( ) ) , set ( KnowledgeDomain . objects . all ( ) [ 0 : 2 ] ) ) #NEWLINE# self . assertEqual ( set ( person . lessons . all ( ) ) , set ( Lesson . objects . all ( ) [ 0 : 2 ] ) )