From 76d6c715952966aac23588c5393986e21c99a989 Mon Sep 17 00:00:00 2001 From: Preston Hansen Date: Thu, 19 Apr 2018 13:17:24 -0500 Subject: [PATCH] tests: Move zerver/fixtures to zerver/tests/fixtures for clarity. Fixes #9153. --- docs/subsystems/markdown.md | 4 ++-- docs/testing/testing-with-django.md | 2 +- frontend_tests/zjsunit/index.js | 2 +- templates/zerver/api/webhook-walkthrough.md | 2 +- tools/linter_lib/custom_check.py | 2 +- tools/release-tarball-exclude.txt | 1 - tools/send-github-payloads | 2 +- tools/setup/generate-fixtures | 4 ++-- tools/update-authors-json | 7 ++++--- zerver/lib/generate_test_data.py | 2 +- zerver/lib/user_agent.py | 2 +- zerver/{ => tests}/fixtures/.gitignore | 0 zerver/{ => tests}/fixtures/authors.json | 0 .../{ => tests}/fixtures/config.generate_data.json | 0 zerver/{ => tests}/fixtures/csp_report.json | 0 .../{ => tests}/fixtures/docs_url_preview_data.json | 0 zerver/{ => tests}/fixtures/duplicate_commits.json | 0 zerver/{ => tests}/fixtures/email/simple.txt | 0 .../{ => tests}/fixtures/markdown_test_cases.json | 0 zerver/{ => tests}/fixtures/narrow.json | 0 .../fixtures/slack_fixtures/test_slack_importer.zip | Bin .../fixtures/slack_fixtures/user_data.json | 0 .../fixtures/slack_message_conversion.json | 0 zerver/{ => tests}/fixtures/stripe.json | 0 zerver/{ => tests}/fixtures/user_agents_unique | 0 zerver/tests/test_bugdown.py | 2 +- zerver/tests/test_decorators.py | 2 +- zerver/tests/test_docs.py | 2 +- zerver/tests/test_email_mirror.py | 2 +- zerver/tests/test_narrow.py | 2 +- zerver/tests/test_notifications.py | 2 +- zerver/tests/test_push_notifications.py | 2 +- zerver/tests/test_report.py | 2 +- zerver/tests/test_slack_importer.py | 4 ++-- zerver/tests/test_slack_message_conversion.py | 2 +- zerver/tests/test_stripe.py | 2 +- zerver/webhooks/helloworld/doc.md | 2 +- zilencer/management/commands/populate_db.py | 2 +- 38 files changed, 29 insertions(+), 29 deletions(-) rename zerver/{ => tests}/fixtures/.gitignore (100%) rename zerver/{ => tests}/fixtures/authors.json (100%) rename zerver/{ => tests}/fixtures/config.generate_data.json (100%) rename zerver/{ => tests}/fixtures/csp_report.json (100%) rename zerver/{ => tests}/fixtures/docs_url_preview_data.json (100%) rename zerver/{ => tests}/fixtures/duplicate_commits.json (100%) rename zerver/{ => tests}/fixtures/email/simple.txt (100%) rename zerver/{ => tests}/fixtures/markdown_test_cases.json (100%) rename zerver/{ => tests}/fixtures/narrow.json (100%) rename zerver/{ => tests}/fixtures/slack_fixtures/test_slack_importer.zip (100%) rename zerver/{ => tests}/fixtures/slack_fixtures/user_data.json (100%) rename zerver/{ => tests}/fixtures/slack_message_conversion.json (100%) rename zerver/{ => tests}/fixtures/stripe.json (100%) rename zerver/{ => tests}/fixtures/user_agents_unique (100%) diff --git a/docs/subsystems/markdown.md b/docs/subsystems/markdown.md index 6178476078..da8840e7ed 100644 --- a/docs/subsystems/markdown.md +++ b/docs/subsystems/markdown.md @@ -38,7 +38,7 @@ The Python-Markdown implementation is tested by `frontend_tests/node_tests/markdown.js`. A shared set of fixed test data ("test fixtures") is present in -`zerver/fixtures/markdown_test_cases.json`, and is automatically used +`zerver/tests/fixtures/markdown_test_cases.json`, and is automatically used by both test suites; as a result, it is the preferred place to add new tests for Zulip's markdown system. Some important notes on reading this file: @@ -99,7 +99,7 @@ places: `static/third/marked/lib/marked.js`), or `markdown.contains_backend_only_syntax` if your changes won't be supported in the frontend processor. * If desired, the typeahead logic in `static/js/composebox_typeahead.js`. -* The test suite, probably via adding entries to `zerver/fixtures/markdown_test_cases.json`. +* The test suite, probably via adding entries to `zerver/tests/fixtures/markdown_test_cases.json`. * The in-app markdown documentation (`templates/zerver/markdown_help.html`). * The list of changes to markdown at the end of this document. diff --git a/docs/testing/testing-with-django.md b/docs/testing/testing-with-django.md index 2bcd2b4c7d..41e1ca463a 100644 --- a/docs/testing/testing-with-django.md +++ b/docs/testing/testing-with-django.md @@ -319,7 +319,7 @@ reads a bunch of sample inputs from a JSON fixture file, feeds them to our GitHub integration code, and then verifies the output against expected values from the same JSON fixture file. -Our fixtures live in `zerver/fixtures`. +Our fixtures live in `zerver/tests/fixtures`. ### Mocks and stubs diff --git a/frontend_tests/zjsunit/index.js b/frontend_tests/zjsunit/index.js index e3c3d63784..716e85cafd 100644 --- a/frontend_tests/zjsunit/index.js +++ b/frontend_tests/zjsunit/index.js @@ -56,7 +56,7 @@ module.prototype.hot = { // Set up fixtures. global.read_fixture_data = (fn) => { - var full_fn = path.join(__dirname, '../../zerver/fixtures/', fn); + var full_fn = path.join(__dirname, '../../zerver/tests/fixtures/', fn); var data = JSON.parse(fs.readFileSync(full_fn, 'utf8', 'r')); return data; }; diff --git a/templates/zerver/api/webhook-walkthrough.md b/templates/zerver/api/webhook-walkthrough.md index 7f80ac1459..5a43979f0e 100644 --- a/templates/zerver/api/webhook-walkthrough.md +++ b/templates/zerver/api/webhook-walkthrough.md @@ -351,7 +351,7 @@ To trigger a notification using this webhook, use (zulip-venv)vagrant@vagrant-ubuntu-trusty-64:/srv/zulip$ ./manage.py send_webhook_fixture_message \ - --fixture=zerver/fixtures/helloworld/hello.json \ + --fixture=zerver/tests/fixtures/helloworld/hello.json \ '--url=http://localhost:9991/api/v1/external/helloworld?api_key=<api_key>' Or, use curl: diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index 621f2c4697..2dca3b9198 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -727,7 +727,7 @@ def build_custom_checkers(by_lang): 'exclude': set(['zerver/webhooks/']), 'description': 'Fix tab-based whitespace'}, {'pattern': ':[\"\[\{]', - 'exclude': set(['zerver/webhooks/', 'zerver/fixtures/']), + 'exclude': set(['zerver/webhooks/', 'zerver/tests/fixtures/']), 'description': 'Require space after : in JSON'}, ] # type: RuleList markdown_rules = markdown_whitespace_rules + prose_style_rules + [ diff --git a/tools/release-tarball-exclude.txt b/tools/release-tarball-exclude.txt index 7ea333a273..2e5de1413b 100644 --- a/tools/release-tarball-exclude.txt +++ b/tools/release-tarball-exclude.txt @@ -10,6 +10,5 @@ templates/zilencer puppet/zulip_ops zproject/dev_settings.py zproject/test_settings.py -zerver/fixtures zerver/tests frontend_tests diff --git a/tools/send-github-payloads b/tools/send-github-payloads index 01c3240935..778b3fefc0 100755 --- a/tools/send-github-payloads +++ b/tools/send-github-payloads @@ -8,7 +8,7 @@ import zulip zulip_client = zulip.Client(site="http://localhost:9991", client="ZulipGithubPayloadSender/0.1") -payload_dir = "zerver/fixtures/github" +payload_dir = "zerver/tests/fixtures/github" for filename in os.listdir(payload_dir): with open(os.path.join(payload_dir, filename)) as f: req = json.loads(f.read()) diff --git a/tools/setup/generate-fixtures b/tools/setup/generate-fixtures index 0396238bdc..93e63dfce2 100755 --- a/tools/setup/generate-fixtures +++ b/tools/setup/generate-fixtures @@ -11,7 +11,7 @@ EOF exit 0 fi -mkdir -p zerver/fixtures +mkdir -p zerver/tests/fixtures "$(dirname "$0")/../../scripts/setup/terminate-psql-sessions" zulip zulip_test zulip_test_base zulip_test_template @@ -32,7 +32,7 @@ sh "$(dirname "$0")/../../scripts/setup/flush-memcached" zerver.UserProfile zerver.Stream zerver.Recipient \ zerver.Subscription zerver.Message zerver.Huddle zerver.Realm \ zerver.UserMessage zerver.Client \ - zerver.DefaultStream > zerver/fixtures/messages.json + zerver.DefaultStream > zerver/tests/fixtures/messages.json # create pristine template database, for fast fixture restoration after tests are run. psql -h localhost postgres zulip_test << EOF diff --git a/tools/update-authors-json b/tools/update-authors-json index 6319fde425..db7d9cc824 100755 --- a/tools/update-authors-json +++ b/tools/update-authors-json @@ -26,8 +26,9 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings' from django.conf import settings from zerver.lib.utils import split_by -FIXTURE_FILE = os.path.join(os.path.dirname(__file__), '../zerver/fixtures/authors.json') -duplicate_commits_file = os.path.join(os.path.dirname(__file__), '../zerver/fixtures/duplicate_commits.json') +FIXTURE_FILE = os.path.join(os.path.dirname(__file__), '../zerver/tests/fixtures/authors.json') +duplicate_commits_file = os.path.join(os.path.dirname(__file__), + '../zerver/tests/fixtures/duplicate_commits.json') parser = argparse.ArgumentParser() parser.add_argument('--max-retries', type=int, default=3, @@ -143,7 +144,7 @@ def run_production() -> None: def copy_fixture() -> None: """ - Copy test fixture file from zerver/fixtures. This is used to avoid + Copy test fixture file from zerver/tests/fixtures. This is used to avoid constantly fetching data from Github during testing. """ subprocess.check_call(['cp', FIXTURE_FILE, settings.CONTRIBUTORS_DATA]) diff --git a/zerver/lib/generate_test_data.py b/zerver/lib/generate_test_data.py index b793e2ae61..a8cad18e4d 100644 --- a/zerver/lib/generate_test_data.py +++ b/zerver/lib/generate_test_data.py @@ -4,7 +4,7 @@ import random from typing import List, Dict, Any, Text, Optional def load_config() -> Dict[str, Any]: - with open("zerver/fixtures/config.generate_data.json", "r") as infile: + with open("zerver/tests/fixtures/config.generate_data.json", "r") as infile: config = ujson.load(infile) return config diff --git a/zerver/lib/user_agent.py b/zerver/lib/user_agent.py index 3b661fc82f..32e2c829df 100644 --- a/zerver/lib/user_agent.py +++ b/zerver/lib/user_agent.py @@ -3,7 +3,7 @@ from typing import Dict # Warning: If you change this parsing, please test using # zerver/tests/test_decorators.py -# And extend zerver/fixtures/user_agents_unique with any new test cases +# And extend zerver/tests/fixtures/user_agents_unique with any new test cases def parse_user_agent(user_agent: str) -> Dict[str, str]: match = re.match("^(?P[^/ ]*[^0-9/(]*)(/(?P[^/ ]*))?([ /].*)?$", user_agent) assert match is not None diff --git a/zerver/fixtures/.gitignore b/zerver/tests/fixtures/.gitignore similarity index 100% rename from zerver/fixtures/.gitignore rename to zerver/tests/fixtures/.gitignore diff --git a/zerver/fixtures/authors.json b/zerver/tests/fixtures/authors.json similarity index 100% rename from zerver/fixtures/authors.json rename to zerver/tests/fixtures/authors.json diff --git a/zerver/fixtures/config.generate_data.json b/zerver/tests/fixtures/config.generate_data.json similarity index 100% rename from zerver/fixtures/config.generate_data.json rename to zerver/tests/fixtures/config.generate_data.json diff --git a/zerver/fixtures/csp_report.json b/zerver/tests/fixtures/csp_report.json similarity index 100% rename from zerver/fixtures/csp_report.json rename to zerver/tests/fixtures/csp_report.json diff --git a/zerver/fixtures/docs_url_preview_data.json b/zerver/tests/fixtures/docs_url_preview_data.json similarity index 100% rename from zerver/fixtures/docs_url_preview_data.json rename to zerver/tests/fixtures/docs_url_preview_data.json diff --git a/zerver/fixtures/duplicate_commits.json b/zerver/tests/fixtures/duplicate_commits.json similarity index 100% rename from zerver/fixtures/duplicate_commits.json rename to zerver/tests/fixtures/duplicate_commits.json diff --git a/zerver/fixtures/email/simple.txt b/zerver/tests/fixtures/email/simple.txt similarity index 100% rename from zerver/fixtures/email/simple.txt rename to zerver/tests/fixtures/email/simple.txt diff --git a/zerver/fixtures/markdown_test_cases.json b/zerver/tests/fixtures/markdown_test_cases.json similarity index 100% rename from zerver/fixtures/markdown_test_cases.json rename to zerver/tests/fixtures/markdown_test_cases.json diff --git a/zerver/fixtures/narrow.json b/zerver/tests/fixtures/narrow.json similarity index 100% rename from zerver/fixtures/narrow.json rename to zerver/tests/fixtures/narrow.json diff --git a/zerver/fixtures/slack_fixtures/test_slack_importer.zip b/zerver/tests/fixtures/slack_fixtures/test_slack_importer.zip similarity index 100% rename from zerver/fixtures/slack_fixtures/test_slack_importer.zip rename to zerver/tests/fixtures/slack_fixtures/test_slack_importer.zip diff --git a/zerver/fixtures/slack_fixtures/user_data.json b/zerver/tests/fixtures/slack_fixtures/user_data.json similarity index 100% rename from zerver/fixtures/slack_fixtures/user_data.json rename to zerver/tests/fixtures/slack_fixtures/user_data.json diff --git a/zerver/fixtures/slack_message_conversion.json b/zerver/tests/fixtures/slack_message_conversion.json similarity index 100% rename from zerver/fixtures/slack_message_conversion.json rename to zerver/tests/fixtures/slack_message_conversion.json diff --git a/zerver/fixtures/stripe.json b/zerver/tests/fixtures/stripe.json similarity index 100% rename from zerver/fixtures/stripe.json rename to zerver/tests/fixtures/stripe.json diff --git a/zerver/fixtures/user_agents_unique b/zerver/tests/fixtures/user_agents_unique similarity index 100% rename from zerver/fixtures/user_agents_unique rename to zerver/tests/fixtures/user_agents_unique diff --git a/zerver/tests/test_bugdown.py b/zerver/tests/test_bugdown.py index 68c46b836a..2bf6176889 100644 --- a/zerver/tests/test_bugdown.py +++ b/zerver/tests/test_bugdown.py @@ -235,7 +235,7 @@ class BugdownTest(ZulipTestCase): def load_bugdown_tests(self) -> Tuple[Dict[Text, Any], List[List[Text]]]: test_fixtures = {} - data_file = open(os.path.join(os.path.dirname(__file__), '../fixtures/markdown_test_cases.json'), 'r') + data_file = open(os.path.join(os.path.dirname(__file__), 'fixtures/markdown_test_cases.json'), 'r') data = ujson.loads('\n'.join(data_file.readlines())) for test in data['regular_tests']: test_fixtures[test['name']] = test diff --git a/zerver/tests/test_decorators.py b/zerver/tests/test_decorators.py index 61edab0db0..b8677c8b74 100644 --- a/zerver/tests/test_decorators.py +++ b/zerver/tests/test_decorators.py @@ -1321,7 +1321,7 @@ class TestUserAgentParsing(ZulipTestCase): def test_user_agent_parsing(self) -> None: """Test for our user agent parsing logic, using a large data set.""" user_agents_parsed = defaultdict(int) # type: Dict[str, int] - user_agents_path = os.path.join(settings.DEPLOY_ROOT, "zerver/fixtures/user_agents_unique") + user_agents_path = os.path.join(settings.DEPLOY_ROOT, "zerver/tests/fixtures/user_agents_unique") for line in open(user_agents_path).readlines(): line = line.strip() match = re.match('^(?P[0-9]+) "(?P.*)"$', line) diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.py index fa9ae66005..71c19f83cc 100644 --- a/zerver/tests/test_docs.py +++ b/zerver/tests/test_docs.py @@ -197,7 +197,7 @@ class AboutPageTest(ZulipTestCase): # 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` + # Copy the fixture file in `zerver/tests/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 diff --git a/zerver/tests/test_email_mirror.py b/zerver/tests/test_email_mirror.py index 4729c65ab9..9c20c48171 100644 --- a/zerver/tests/test_email_mirror.py +++ b/zerver/tests/test_email_mirror.py @@ -325,7 +325,7 @@ class TestReplyExtraction(ZulipTestCase): self.assertEqual(message.content, 'Reply') -MAILS_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "fixtures", "email") +MAILS_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "tests", "fixtures", "email") class TestScriptMTA(ZulipTestCase): diff --git a/zerver/tests/test_narrow.py b/zerver/tests/test_narrow.py index 5b5cb44ad7..2e0d66727b 100644 --- a/zerver/tests/test_narrow.py +++ b/zerver/tests/test_narrow.py @@ -347,7 +347,7 @@ class NarrowBuilderTest(ZulipTestCase): class BuildNarrowFilterTest(TestCase): def test_build_narrow_filter(self) -> None: fixtures_path = os.path.join(os.path.dirname(__file__), - '../fixtures/narrow.json') + 'fixtures/narrow.json') scenarios = ujson.loads(open(fixtures_path, 'r').read()) self.assertTrue(len(scenarios) == 9) for scenario in scenarios: diff --git a/zerver/tests/test_notifications.py b/zerver/tests/test_notifications.py index 6441202914..775748f400 100644 --- a/zerver/tests/test_notifications.py +++ b/zerver/tests/test_notifications.py @@ -484,7 +484,7 @@ class TestMissedMessages(ZulipTestCase): # Run `relative_to_full_url()` function over test fixtures present in # 'markdown_test_cases.json' and check that it converts all the relative # URLs to absolute URLs. - fixtures_file = os.path.join(settings.DEPLOY_ROOT, "zerver", + fixtures_file = os.path.join(settings.DEPLOY_ROOT, "zerver", "tests", "fixtures", "markdown_test_cases.json") fixtures = ujson.load(open(fixtures_file)) test_fixtures = {} diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.py index 59e6b37fd6..e3730c8b2f 100644 --- a/zerver/tests/test_push_notifications.py +++ b/zerver/tests/test_push_notifications.py @@ -43,7 +43,7 @@ from zilencer.models import RemoteZulipServer, RemotePushDeviceToken from django.utils.timezone import now ZERVER_DIR = os.path.dirname(os.path.dirname(__file__)) -FIXTURES_FILE_PATH = os.path.join(ZERVER_DIR, "fixtures", "markdown_test_cases.json") +FIXTURES_FILE_PATH = os.path.join(ZERVER_DIR, "tests", "fixtures", "markdown_test_cases.json") class BouncerTestCase(ZulipTestCase): def setUp(self) -> None: diff --git a/zerver/tests/test_report.py b/zerver/tests/test_report.py index 0f7fd26993..1bb6c8d5fa 100644 --- a/zerver/tests/test_report.py +++ b/zerver/tests/test_report.py @@ -154,7 +154,7 @@ class TestReport(ZulipTestCase): def test_report_csp_violations(self) -> None: fixture_data_file = open(os.path.join(os.path.dirname(__file__), - '../fixtures/csp_report.json'), 'r') + 'fixtures/csp_report.json'), 'r') fixture_data = ujson.load(fixture_data_file) params = ujson.dumps(fixture_data) result = self.client_post("/report/csp_violations", params, content_type="application/json") diff --git a/zerver/tests/test_slack_importer.py b/zerver/tests/test_slack_importer.py index 0ee2fa8514..a07ebf0fe8 100644 --- a/zerver/tests/test_slack_importer.py +++ b/zerver/tests/test_slack_importer.py @@ -473,7 +473,7 @@ class SlackImporter(ZulipTestCase): mock_build_avatar: mock.Mock, mock_process_uploads: mock.Mock, mock_attachment: mock.Mock) -> None: - test_slack_dir = os.path.join(settings.DEPLOY_ROOT, "zerver", "fixtures", + test_slack_dir = os.path.join(settings.DEPLOY_ROOT, "zerver", "tests", "fixtures", "slack_fixtures") test_slack_zip_file = os.path.join(test_slack_dir, "test_slack_importer.zip") test_slack_unzipped_file = os.path.join(test_slack_dir, "test_slack_importer") @@ -489,7 +489,7 @@ class SlackImporter(ZulipTestCase): # Also the unzipped data file should be removed if the test fails at 'do_convert_data' rm_tree(test_slack_unzipped_file) - user_data_fixture = os.path.join(settings.DEPLOY_ROOT, "zerver", "fixtures", + user_data_fixture = os.path.join(settings.DEPLOY_ROOT, "zerver", "tests", "fixtures", "slack_fixtures", "user_data.json") mock_get_slack_api_data.side_effect = [ujson.load(open(user_data_fixture))['members'], {}] diff --git a/zerver/tests/test_slack_message_conversion.py b/zerver/tests/test_slack_message_conversion.py index 0a2e0ce7e9..4a62d5abf3 100644 --- a/zerver/tests/test_slack_message_conversion.py +++ b/zerver/tests/test_slack_message_conversion.py @@ -26,7 +26,7 @@ class SlackMessageConversion(ZulipTestCase): def load_slack_message_conversion_tests(self) -> Dict[Any, Any]: test_fixtures = {} - data_file = open(os.path.join(os.path.dirname(__file__), '../fixtures/slack_message_conversion.json'), 'r') + data_file = open(os.path.join(os.path.dirname(__file__), 'fixtures/slack_message_conversion.json'), 'r') data = ujson.loads('\n'.join(data_file.readlines())) for test in data['regular_tests']: test_fixtures[test['name']] = test diff --git a/zerver/tests/test_stripe.py b/zerver/tests/test_stripe.py index 264cf876db..7ef2af92f4 100644 --- a/zerver/tests/test_stripe.py +++ b/zerver/tests/test_stripe.py @@ -11,7 +11,7 @@ from zerver.models import Realm, UserProfile from zilencer.lib.stripe import StripeError, save_stripe_token, catch_stripe_errors from zilencer.models import Customer -fixture_data_file = open(os.path.join(os.path.dirname(__file__), '../fixtures/stripe.json'), 'r') +fixture_data_file = open(os.path.join(os.path.dirname(__file__), 'fixtures/stripe.json'), 'r') fixture_data = ujson.load(fixture_data_file) def mock_list_sources(*args: Any, **kwargs: Any) -> ListObject: diff --git a/zerver/webhooks/helloworld/doc.md b/zerver/webhooks/helloworld/doc.md index ca549fcafe..b6d30cb8a2 100644 --- a/zerver/webhooks/helloworld/doc.md +++ b/zerver/webhooks/helloworld/doc.md @@ -17,7 +17,7 @@ To trigger a notification using this webhook, use ``` (zulip-venv)vagrant@vagrant-ubuntu-trusty-64:/srv/zulip$ ./manage.py send_webhook_fixture_message \ -> --fixture=zerver/fixtures/helloworld/hello.json \ +> --fixture=zerver/tests/fixtures/helloworld/hello.json \ > '--url=http://localhost:9991/api/v1/external/helloworld?api_key=<api_key>' ``` diff --git a/zilencer/management/commands/populate_db.py b/zilencer/management/commands/populate_db.py index 2137b6ba25..f7b43a1129 100644 --- a/zilencer/management/commands/populate_db.py +++ b/zilencer/management/commands/populate_db.py @@ -317,7 +317,7 @@ class Command(BaseCommand): # in the config.generate_data.json data set. This makes it # possible for populate_db to run happily without Internet # access. - with open("zerver/fixtures/docs_url_preview_data.json", "r") as f: + with open("zerver/tests/fixtures/docs_url_preview_data.json", "r") as f: urls_with_preview_data = ujson.load(f) for url in urls_with_preview_data: cache_set(url, urls_with_preview_data[url], PREVIEW_CACHE_NAME)