Пример #1
0
    def test_job_show_object(self):
        source_obj = harvest_factories.HarvestSourceObj()
        job = harvest_factories.HarvestJob(source=source_obj)

        context = {
            'model': model,
            'session': model.Session,
            'ignore_auth': True,
        }
        data_dict = {
            'guid': 'guid',
            'content': 'test content',
            'job_id': job['id'],
            'source_id': source_obj.id,
            'extras': {'a key': 'a value'},
        }
        harvest_object = toolkit.get_action('harvest_object_create')(
            context, data_dict)

        app = self._get_test_app()
        url = url_for('harvest_object_show', id=harvest_object['id'])

        response = app.get(url)

        assert_in(data_dict['content'], response.unicode_body)
Пример #2
0
    def test_job_page_rendered(self):

        job = harvest_factories.HarvestJob()
        app = self._get_test_app()
        url = url_for('harvest_job_list', source=job['source_id'])

        response = app.get(url, extra_environ=self.extra_environ)

        assert_in(job['id'], response.unicode_body)
Пример #3
0
    def test_admin_page_rendered(self):

        source_obj = harvest_factories.HarvestSourceObj()
        job = harvest_factories.HarvestJob(source=source_obj)

        app = self._get_test_app()
        url = url_for('harvest_admin', id=source_obj.id)

        response = app.get(url, extra_environ=self.extra_environ)

        assert_in(source_obj.title, response.unicode_body)

        assert_in(job['id'], response.unicode_body)