mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 10:57:58 +00:00
tests: Move AuthorsPageTest to test_docs.py.
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.test import TestCase, override_settings
|
from django.test import TestCase, override_settings
|
||||||
@@ -112,3 +113,27 @@ class IntegrationTest(TestCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
context['subscriptions_html'],
|
context['subscriptions_html'],
|
||||||
'<a target="_blank" href="../#subscriptions">subscriptions page</a>')
|
'<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
|
||||||
|
)
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import ujson
|
import ujson
|
||||||
import subprocess
|
|
||||||
|
|
||||||
K = TypeVar('K')
|
K = TypeVar('K')
|
||||||
V = TypeVar('V')
|
V = TypeVar('V')
|
||||||
@@ -466,30 +465,6 @@ class GetProfileTest(ZulipTestCase):
|
|||||||
avatar_url(user_profile),
|
avatar_url(user_profile),
|
||||||
)
|
)
|
||||||
|
|
||||||
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
|
|
||||||
)
|
|
||||||
|
|
||||||
class MutedTopicsTests(ZulipTestCase):
|
class MutedTopicsTests(ZulipTestCase):
|
||||||
def test_json_set(self):
|
def test_json_set(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
|
|||||||
Reference in New Issue
Block a user