|
a/ForgeDiscussion/forgediscussion/tests/test_app.py |
|
b/ForgeDiscussion/forgediscussion/tests/test_app.py |
|
... |
|
... |
19 |
|
19 |
|
20 |
#-*- python -*-
|
20 |
#-*- python -*-
|
21 |
|
21 |
|
22 |
import tempfile
|
22 |
import tempfile
|
23 |
import json
|
23 |
import json
|
|
|
24 |
|
24 |
from nose.tools import assert_equal
|
25 |
from nose.tools import assert_equal
|
|
|
26 |
from pylons import tmpl_context as c
|
25 |
|
27 |
|
26 |
from allura import model as M
|
28 |
from allura import model as M
|
27 |
from forgediscussion.tests.functional.test_rest import TestDiscussionApiBase
|
29 |
from forgediscussion.tests.functional.test_rest import TestDiscussionApiBase
|
28 |
|
30 |
|
29 |
|
31 |
|
30 |
class TestBulkExport(TestDiscussionApiBase):
|
32 |
class TestBulkExport(TestDiscussionApiBase):
|
31 |
|
33 |
|
32 |
def test_bulk_export(self):
|
34 |
def test_bulk_export(self):
|
|
|
35 |
# Clear out some context vars, to properly simulate how this is run from the export task
|
|
|
36 |
# Besides, it's better not to need c context vars
|
|
|
37 |
c.app = c.project = None
|
|
|
38 |
|
33 |
project = M.Project.query.get(shortname='test')
|
39 |
project = M.Project.query.get(shortname='test')
|
34 |
discussion = project.app_instance('discussion')
|
40 |
discussion = project.app_instance('discussion')
|
35 |
f = tempfile.TemporaryFile()
|
41 |
f = tempfile.TemporaryFile()
|
36 |
discussion.bulk_export(f)
|
42 |
discussion.bulk_export(f)
|
37 |
f.seek(0)
|
43 |
f.seek(0)
|