Ejemplo n.º 1
0
    def test_format_file_uploaded_msg(self):
        upload_to = '/'
        detail = file_uploaded_msg_to_json('upload_msg', self.repo.id, upload_to)
        notice = UserNotification.objects.add_file_uploaded_msg('*****@*****.**', detail)
        resp = Command().format_file_uploaded_msg(notice)

        assert resp.folder_link == '/library/%(repo_id)s/%(repo_name)s/%(path)s' % {
                'repo_id': self.repo.id, 'repo_name': self.repo.name, 'path': upload_to.strip('/')}
Ejemplo n.º 2
0
    def test_format_file_uploaded_msg(self):
        upload_to = '/'
        detail = file_uploaded_msg_to_json('upload_msg', self.repo.id, upload_to)
        notice = UserNotification.objects.add_file_uploaded_msg('*****@*****.**', detail)

        msg = notice.format_file_uploaded_msg()
        assert '/#common/lib/%(repo_id)s/%(path)s' % {'repo_id': self.repo.id,
                                                      'path': upload_to.strip('/')} in msg