mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
tests: Move AuthorsPageTest to test_docs.py.
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user