|
1 | 1 | # -*- coding: utf-8 -*- |
2 | 2 | import os.path |
3 | 3 | import types |
4 | | -import shutil |
5 | | -from StringIO import StringIO |
6 | | -from pipe import pipe |
| 4 | +#import json |
| 5 | +#from pathlib import Path |
7 | 6 |
|
8 | 7 | from textwrap import dedent |
9 | 8 | from email.mime.text import MIMEText |
10 | 9 | from email.mime.image import MIMEImage |
11 | 10 | from email.mime.multipart import MIMEMultipart |
12 | 11 |
|
13 | 12 | from django.conf import settings |
14 | | -from django.core.management import call_command |
15 | 13 | from django.template import Context |
16 | 14 | from django.template.defaulttags import URLNode |
17 | 15 | from django.templatetags.static import StaticNode |
|
23 | 21 | import ietf.urls |
24 | 22 | from ietf.utils.management.commands import pyflakes |
25 | 23 | from ietf.utils.mail import send_mail_text, send_mail_mime, outbox |
26 | | -from ietf.utils.test_data import make_test_data |
27 | 24 | from ietf.utils.test_runner import get_template_paths |
28 | | -from ietf.group.models import Group |
29 | 25 |
|
30 | 26 | class PyFlakesTestCase(TestCase): |
31 | 27 |
|
@@ -190,46 +186,6 @@ def check_that_static_tags_resolve(node, origin, checked): |
190 | 186 | settings.DEBUG = saved_debug |
191 | 187 |
|
192 | 188 |
|
193 | | -class TestWikiGlueManagementCommand(TestCase): |
194 | | - |
195 | | - def setUp(self): |
196 | | - self.wiki_dir_pattern = os.path.abspath('tmp-wiki-dir-root/%s') |
197 | | - if not os.path.exists(self.wiki_dir_pattern): |
198 | | - os.mkdir(os.path.dirname(self.wiki_dir_pattern)) |
199 | | - |
200 | | - def tearDown(self): |
201 | | - shutil.rmtree(os.path.dirname(self.wiki_dir_pattern)) |
202 | | - |
203 | | - def test_wiki_create_output(self): |
204 | | - make_test_data() |
205 | | - groups = Group.objects.filter( |
206 | | - type__slug__in=['wg','rg','area'], |
207 | | - state__slug='active' |
208 | | - ).order_by('acronym') |
209 | | - out = StringIO() |
210 | | - call_command('create_group_wikis', stdout=out, verbosity=2, wiki_dir_pattern=self.wiki_dir_pattern) |
211 | | - command_output = out.getvalue() |
212 | | - for group in groups: |
213 | | - self.assertIn("Processing group %s" % group.acronym, command_output) |
214 | | - # Do a bit of verification using trac-admin, too |
215 | | - admin_code, admin_output, admin_error = pipe('trac-admin %s permission list' % (self.wiki_dir_pattern % group.acronym)) |
216 | | - self.assertEqual(admin_code, 0) |
217 | | - roles = group.role_set.filter(name_id__in=['chair', 'secr', 'ad']) |
218 | | - for role in roles: |
219 | | - user = role.email.address.lower() |
220 | | - self.assertIn("Granting admin permission for %s" % user, command_output) |
221 | | - self.assertIn(user, admin_output) |
222 | | - docs = group.document_set.filter(stats_slug='active', type_id='draft') |
223 | | - for doc in docs: |
224 | | - name = doc.name |
225 | | - name = name.replace('draft-','') |
226 | | - name = name.replace(group.stream+'-', '') |
227 | | - name = name.replace(group.acronym+'-', '') |
228 | | - self.assertIn("Adding component %s"%name, command_output) |
229 | | - for page in settings.TRAC_WIKI_PAGES_TEMPLATES: |
230 | | - self.assertIn("Adding page %s" % os.path.basename(page), command_output) |
231 | | - self.assertIn("Indexing default repository", command_output) |
232 | | - |
233 | 189 | ## One might think that the code below would work, but it doesn't ... |
234 | 190 |
|
235 | 191 | # def list_static_files(path): |
|
0 commit comments