#NEWLINE# def test_readonly_role_submission_when_requires_auth( self ) : #NEWLINE# #INDENT# self . _publish_xls_form_to_project ( ) #NEWLINE# self . user . profile . require_auth = True #NEWLINE# self . user . profile . save ( ) #NEWLINE# alice_data = { #NEWLINE# #INDENT# 'username' : 'alice' , #NEWLINE# 'email' : 'alice@localhost.com' , #NEWLINE# 'password1' : 'alice' , #NEWLINE# 'password2' : 'alice' , #NEWLINE# #UNINDENT# } #NEWLINE# self . _login_user_and_profile ( extra_post_data = alice_data ) #NEWLINE# role . ReadOnlyRole . add ( self . user , self . xform ) #NEWLINE# paths = [ os . path . join ( self . main_directory , 'fixtures' , 'transportation' , 'instances' , s , ( s + '.xml' ) ) for s in self . surveys ] #NEWLINE# auth = DigestAuth ( 'alice' , 'alice' ) #NEWLINE# self . _make_submission ( paths [ 0 ] , username = 'bob' , auth = auth ) #NEWLINE# self . assertEqual ( self . response . status_code , 403 )