def test_developer_comment(self): self.profile.addonuser_set.create(addon=self.app) note = save_from_email_reply(self.email_base64) eq_(note.note_type, comm.DEVELOPER_COMMENT)
def test_with_invalid_msg(self): assert not save_from_email_reply('youtube?v=WwJjts9FzxE')
def test_successful_save(self): note = save_from_email_reply(self.email_base64) eq_(note.body, 'test note 5\n')
def test_reviewer_comment(self): self.grant_permission(self.profile, 'ContentTools:AddonReview') note = save_from_email_reply(self.email_base64) eq_(note.note_type, comm.REVIEWER_PUBLIC_COMMENT)
def test_non_existent_token(self): self.token.update(uuid='youtube?v=wn4RP57Y7bw') assert not save_from_email_reply(self.email_base64)
def test_with_unpermitted_token(self): """Test when the token's user does not have a permission on thread.""" self.profile.groupuser_set.filter( group__rules__contains='Apps:Review').delete() assert not save_from_email_reply(self.email_base64)
def test_with_unpermitted_token(self): """Test when the token's user does not have a permission on thread.""" self.profile.groupuser_set.all().delete() assert not save_from_email_reply(self.email_base64)
def consume_email(email_text, **kwargs): """Parse emails and save notes.""" res = save_from_email_reply(email_text) if not res: log.error('Failed to save email.')
def test_developer_comment(self): self.profile.extension_set.add(self.extension) note = save_from_email_reply(self.email_base64) eq_(note.note_type, comm.DEVELOPER_COMMENT)
def test_reviewer_comment(self): self.grant_permission(self.profile, 'Apps:Review') note = save_from_email_reply(self.email_base64) eq_(note.note_type, comm.REVIEWER_COMMENT)
def test_with_max_count_token(self): # Test with an invalid token. self.token.update(use_count=comm.MAX_TOKEN_USE_COUNT + 1) assert not save_from_email_reply(self.email_base64)