tests: Move AuthorsPageTest to test_docs.py.

This commit is contained in:
Tim Abbott
2017-03-08 03:33:50 -08:00
parent 881169f08a
commit 46362dfcca
2 changed files with 25 additions and 25 deletions

View File

@@ -2,6 +2,7 @@
from __future__ import absolute_import
import os
import subprocess
from django.conf import settings
from django.test import TestCase, override_settings
@@ -112,3 +113,27 @@ class IntegrationTest(TestCase):
self.assertEqual(
context['subscriptions_html'],
'<a target="_blank" href="../#subscriptions">subscriptions page</a>')
class AuthorsPageTest(ZulipTestCase):
def setUp(self):
# type: () -> None
""" Manual installation which did not execute `tools/provision`
would not have the `static/generated/github-contributors.json` fixture
file.
"""
# This block has unreliable test coverage due to the implicit
# caching here, so we exclude it from coverage.
if not os.path.exists(settings.CONTRIBUTORS_DATA):
# Copy the fixture file in `zerver/fixtures` to `static/generated`
update_script = os.path.join(os.path.dirname(__file__),
'../../tools/update-authors-json') # nocoverage
subprocess.check_call([update_script, '--use-fixture']) # nocoverage
def test_endpoint(self):
# type: () -> None
result = self.client_get('/authors/')
self.assert_in_success_response(
['Contributors', 'Statistic last Updated:', 'commits',
'@timabbott'],
result
)