|
4 | 4 | import datetime |
5 | 5 | import os |
6 | 6 | import argparse |
| 7 | +import math |
7 | 8 | from itertools import cycle |
8 | 9 |
|
9 | 10 | from flask import current_app |
|
15 | 16 | from sdconfig import config |
16 | 17 | from db import db |
17 | 18 | from models import Journalist, Reply, Source, Submission |
18 | | -from specialstrings import submissions |
| 19 | +from specialstrings import strings |
19 | 20 |
|
20 | 21 |
|
21 | | -replies = cycle([ |
22 | | - 'This is a test reply without markup!', |
23 | | - 'This is a test reply with markup and characters such as \, \\, \', \" and ". ' + # noqa: W605, E501 |
24 | | - '<strong>This text should not be bold</strong>!' |
25 | | -]) |
| 22 | +submissions = cycle(strings) |
| 23 | +replies = cycle(strings) |
26 | 24 |
|
27 | 25 |
|
28 | 26 | def main(staging=False): |
@@ -54,9 +52,9 @@ def main(staging=False): |
54 | 52 |
|
55 | 53 | NUM_SOURCES = os.getenv('NUM_SOURCES', 2) |
56 | 54 | if NUM_SOURCES == "ALL": |
57 | | - # We want all strings, 14 sources will give all the strings based |
58 | | - # on current string count. |
59 | | - NUM_SOURCES = 14 |
| 55 | + # We ingest two strings per source, so this will create the required |
| 56 | + # number of sources to include all special strings |
| 57 | + NUM_SOURCES = math.ceil(len(strings) / 2) |
60 | 58 | # Add test sources and submissions |
61 | 59 | num_sources = int(NUM_SOURCES) |
62 | 60 | for i in range(1, num_sources + 1): |
|
0 commit comments