@@ -143,6 +143,27 @@ def test_edit_publickey_view(self):
143143 login_testing_unauthorized (self , COMMUNITY_USER , self .public_key_url )
144144 login_testing_unauthorized (self , CHAIR_USER , self .public_key_url )
145145 self .check_url_status (self .public_key_url , 200 )
146+ f = open (self .cert_file .name )
147+ response = self .client .post (self .public_key_url , {'public_key' : f })
148+ f .close ()
149+ self .assertEqual (response .status_code , 200 )
150+
151+ nominee = Nominee .objects .get (email__person__name = COMMUNITY_USER )
152+ position = Position .objects .get (name = 'OAM' )
153+
154+ comments = 'plain text'
155+ feedback = Feedback .objects .create (position = position ,
156+ nominee = nominee ,
157+ comments = comments ,
158+ type = FeedbackType .objects .get (slug = 'nomina' ))
159+
160+ # to check feedback comments are saved like enrypted data
161+ self .assertNotEqual (feedback .comments , comments )
162+
163+ self .assertEqual (check_comments (feedback .comments ,
164+ comments ,
165+ self .privatekey_file ), True )
166+
146167 self .client .logout ()
147168
148169 def test_index_view (self ):
@@ -272,9 +293,9 @@ def test_encrypted_comments(self):
272293
273294 comments = 'plain text'
274295 feedback = Feedback .objects .create (position = position ,
275- nominee = nominee ,
276- comments = comments ,
277- type = FeedbackType .objects .get (slug = 'nomina' ))
296+ nominee = nominee ,
297+ comments = comments ,
298+ type = FeedbackType .objects .get (slug = 'nomina' ))
278299
279300 # to check feedback comments are saved like enrypted data
280301 self .assertNotEqual (feedback .comments , comments )
0 commit comments