def setUp(self): self.app.data.insert('desks', [{'_id': ObjectId('54e698a31024542de76d664a'), 'source': 'AAP'}]) self.stage = self.app.data.insert('stages', [{"_id": ObjectId('54e698a31024542de76d6649'), "working_stage": True, "default_incoming": True, "desk": ObjectId('54e698a31024542de76d664a')}]) init_app(self.app)
def setUp(self): super().setUp() with self.app.app_context(): self.app.data.insert("subscribers", self.subscribers) self.app.data.insert("publish_queue", self.queue_items) init_app(self.app)
def setUp(self): with self.app.app_context(): self.app.data.insert("subscribers", self.subscribers) self.queue_items[0]["_id"] = ObjectId(self.queue_items[0]["_id"]) self.app.data.insert("publish_queue", self.queue_items) init_app(self.app)
def setUp(self): super().setUp() with self.app.app_context(): self.app.data.insert('subscribers', self.subscribers) self.app.data.insert('publish_queue', self.queue_items) init_app(self.app)
def setUp(self): with self.app.app_context(): self.app.data.insert('subscribers', self.subscribers) self.queue_items[0]['_id'] = ObjectId(self.queue_items[0]['_id']) self.app.data.insert('publish_queue', self.queue_items) init_app(self.app)
def setUp(self): super().setUp() with self.app.app_context(): self.app.data.insert('subscribers', self.subscribers) self.app.data.insert('vocabularies', self.vocab) self.app.data.insert('desks', self.desks) init_app(self.app)
def setUp(self): super().setUp() with self.app.app_context(): self.app.data.insert('stages', self.stages) self.app.data.insert('desks', self.desks) self.app.data.insert('archive', self.articles) self.app.data.insert('published', self.published) init_app(self.app)
def setUp(self): super().setUp() with self.app.app_context(): self.app.data.insert('output_channels', self.output_channels) self.app.data.insert('subscribers', self.subscribers) self.app.data.insert('destination_groups', self.destination_groups) self.app.data.insert('archive', self.articles) init_app(self.app)
def setUp(self): super().setUp() with self.app.app_context(): self.app.data.insert('output_channels', self.output_channel) self.app.data.insert('subscribers', self.subscriber) self.app.data.insert('publish_queue', self.queue_items) init_app(self.app)
def setUp(self): super().setUp() self.subscribers[0]['destinations'][0]['config']['connection_string'] = \ superdesk.app.config["ODBC_TEST_CONNECTION_STRING"] self.app.data.insert('subscribers', self.subscribers) self.queue_items[0]['destination']['config']['connection_string'] = \ superdesk.app.config["ODBC_TEST_CONNECTION_STRING"] self.app.data.insert('publish_queue', self.queue_items) init_app(self.app)
def setUp(self): self.article['state'] = 'published' self.article['firstcreated'] = self.now self.article['versioncreated'] = self.now self.newsml = etree.Element("NewsML") self.formatter = NewsMLG2Formatter() self.formatter.now = self.now self.formatter.string_now = self.now.strftime('%Y-%m-%dT%H:%M:%S.0000Z') init_app(self.app) self.app.data.insert('vocabularies', self.vocab) self.app.data.insert('archive', self.packaged_articles)
def setUp(self): super().setUp() self.article['state'] = 'published' self.article['firstcreated'] = self.now self.article['versioncreated'] = self.now self.newsml = etree.Element("NewsML") self.formatter = NewsML12Formatter() self.formatter.now = self.now self.formatter.string_now = self.now.strftime('%Y%m%dT%H%M%S+0000') with self.app.app_context(): init_app(self.app) self.app.data.insert('vocabularies', self.vocab)
def setUp(self): super().setUp() self.article["state"] = "published" self.article["firstcreated"] = self.now self.article["versioncreated"] = self.now self.newsml = etree.Element("NewsML") self.formatter = NewsML12Formatter() self.formatter.now = self.now self.formatter.string_now = self.now.strftime("%Y%m%dT%H%M%S+0000") with self.app.app_context(): init_app(self.app) self.app.data.insert("vocabularies", self.vocab)
def setUp(self): super().setUp() self._init_data() self.app.data.insert('users', self.users) self.app.data.insert('desks', self.desks) self.app.data.insert('vocabularies', self.vocabularies) self.app.data.insert('subscribers', self.subscribers) self.app.data.insert(ARCHIVE, self.articles) self.filename = os.path.join( os.path.abspath(os.path.dirname(__file__)), "validators.json") self.json_data = [ { "_id": "kill_text", "act": "kill", "type": "text", "schema": { "headline": { "type": "string" } } }, { "_id": "publish_text", "act": "publish", "type": "text", "schema": {} }, { "_id": "correct_text", "act": "correct", "type": "text", "schema": {} }, { "_id": "publish_composite", "act": "publish", "type": "composite", "schema": {} }, ] with open(self.filename, "w+") as file: json.dump(self.json_data, file) init_app(self.app) ValidatorsPopulateCommand().run(self.filename) self.package_service = PackageService()
def setUp(self): super().setUp() with self.app.app_context(): self.init_data() self.app.data.insert('output_channels', self.output_channels) self.app.data.insert('subscribers', self.subscribers) self.app.data.insert('destination_groups', self.destination_groups) self.app.data.insert('archive', self.articles) self.filename = os.path.join(os.path.abspath(os.path.dirname(__file__)), "validators.json") self.json_data = [{"_id": "kill", "schema": {"headline": {"type": "string"}}}] self.article_versions = self.__init_article_versions() with open(self.filename, "w+") as file: json.dump(self.json_data, file) init_app(self.app)
def setUp(self): self.formatter = AAPNINJSFormatter() init_app(self.app) self.maxDiff = None self.app.data.insert('vocabularies', [ { "_id": "locators", "display_name": "Locators", "type": "unmanageable", "unique_field": "qcode", "items": [ {"is_active": True, "name": "NSW", "qcode": "NSW", "state": "New South Wales", "country": "Australia", "world_region": "Oceania", "group": "Australia"}, ], } ])
def setUp(self): self.formatter = AAPNewsroomNinjsFormatter() init_app(self.app) self.maxDiff = None self.app.data.insert('vocabularies', [{ "_id": "locators", "display_name": "Locators", "type": "unmanageable", "unique_field": "qcode", "items": [ { "is_active": True, "name": "NSW", "qcode": "NSW", "state": "New South Wales", "country": "Australia", "world_region": "Oceania", "group": "Australia" }, ], }, { "_id": "crop_sizes", "display_name": "Image Crop Sizes", "type": "manageable", "items": [{ "width": 800, "is_active": True, "height": 600, "name": "4-3" }, { "width": 1280, "is_active": True, "height": 720, "name": "16-9" }], "unique_field": "name", "selection_type": "do not show" }])
def setUp(self): super().setUp() with self.app.app_context(): self.init_data() self.app.data.insert('subscribers', self.subscribers) self.app.data.insert('archive', self.articles) self.filename = os.path.join(os.path.abspath(os.path.dirname(__file__)), "validators.json") self.json_data = [ {"_id": "kill_text", "act": "kill", "type": "text", "schema": {"headline": {"type": "string"}}}, {"_id": "publish_text", "act": "publish", "type": "text", "schema": {}}, {"_id": "correct_text", "act": "correct", "type": "text", "schema": {}} ] self.article_versions = self.__init_article_versions() with open(self.filename, "w+") as file: json.dump(self.json_data, file) init_app(self.app) ValidatorsPopulateCommand().run(self.filename)
def setUp(self): super().setUp() self._init_data() self.app.data.insert('vocabularies', self.vocabularies) self.app.data.insert('subscribers', self.subscribers) self.app.data.insert(ARCHIVE, self.articles) self.filename = os.path.join(os.path.abspath(os.path.dirname(__file__)), "validators.json") self.json_data = [ {"_id": "kill_text", "act": "kill", "type": "text", "schema": {"headline": {"type": "string"}}}, {"_id": "publish_text", "act": "publish", "type": "text", "schema": {}}, {"_id": "correct_text", "act": "correct", "type": "text", "schema": {}}, {"_id": "publish_composite", "act": "publish", "type": "composite", "schema": {}}, ] with open(self.filename, "w+") as file: json.dump(self.json_data, file) init_app(self.app) ValidatorsPopulateCommand().run(self.filename) self.package_service = PackageService()
def setUp(self): super().setUp() vocabularies = [{ '_id': 'categories', 'display_name': 'Categories', 'type': 'manageable', 'items': [ {'is_active': True, 'name': 'Australian General News', 'qcode': 'a'}, {'is_active': True, 'name': 'Australian Weather', 'qcode': 'b', 'subject': '17000000'}, {'is_active': True, 'name': 'General Features', 'qcode': 'c'}, {'is_active': False, 'name': 'Reserved (obsolete/unused)', 'qcode': 'd'}, {'is_active': True, 'name': 'Entertainment', 'qcode': 'e', 'subject': '01000000'}, {'is_active': True, 'name': 'Finance', 'qcode': 'f', 'subject': '04000000'}, {'is_active': False, 'name': 'SportSet', 'qcode': 'g'}, {'is_active': True, 'name': 'FormGuide', 'qcode': 'h'}, {'is_active': True, 'name': 'International News', 'qcode': 'i'}, {'is_active': False, 'name': 'Reserved (obsolete/unused)', 'qcode': 'k'}, {'is_active': True, 'name': 'Press Release Service', 'qcode': 'j'}, {'is_active': True, 'name': 'Lotteries', 'qcode': 'l'}, {'is_active': True, 'name': 'Line Check Messages', 'qcode': 'm'}, {'is_active': False, 'name': 'Reserved', 'qcode': 'n'}, {'is_active': True, 'name': 'State Parliaments', 'qcode': 'o', 'subject': '11000000'}, {'is_active': True, 'name': 'Federal Parliament', 'qcode': 'p', 'subject': '11000000'}, {'is_active': True, 'name': 'Stockset', 'qcode': 'q', 'subject': '04000000'}, {'is_active': True, 'name': 'Racing (Turf)', 'qcode': 'r', 'subject': '15000000'}, {'is_active': True, 'name': 'Overseas Sport', 'qcode': 's', 'subject': '15000000'}, {'is_active': True, 'name': 'Domestic Sport', 'qcode': 't', 'subject': '15000000'}, {'is_active': False, 'name': 'Reserved (Obsolete/unused)', 'qcode': 'u'}, {'is_active': True, 'name': 'Advisories', 'qcode': 'v'}, {'is_active': False, 'name': 'Reserved (Obsolete/unused)', 'qcode': 'w'}, {'is_active': True, 'name': 'Special Events (olympics/ Aus elections)', 'qcode': 'x'}, {'is_active': False, 'name': 'Special Events (obsolete/unused)', 'qcode': 'y'}, {'is_active': False, 'name': 'Supplementary Traffic', 'qcode': 'z'} ] }] self.app.data.insert('vocabularies', vocabularies) init_app(self.app)
def setUp(self): self.formatter = AAPNINJSFormatter() init_app(self.app) self.maxDiff = None self.app.data.insert('vocabularies', [ { "_id": "locators", "display_name": "Locators", "type": "unmanageable", "unique_field": "qcode", "items": [ {"is_active": True, "name": "NSW", "qcode": "NSW", "state": "New South Wales", "country": "Australia", "world_region": "Oceania", "group": "Australia"}, ], }, { "_id": "crop_sizes", "display_name": "Image Crop Sizes", "type": "manageable", "items": [ { "width": 800, "is_active": True, "height": 600, "name": "4-3" }, { "width": 1280, "is_active": True, "height": 720, "name": "16-9" } ], "unique_field": "name", "selection_type": "do not show" } ])
def setUp(self): super().setUp() self.app.data.insert('subscribers', self.subscribers) init_app(self.app) self._formatter = AAPBulletinBuilderFormatter()
def setUp(self): self.app.data.insert('subscribers', self.subscribers) self.app.data.insert('published', self.published) init_app(self.app) self.app.config['TEST_SMS_OUTPUT'] = False
def setUp(self): init_app(self.app)
def setUp(self): init_app(self.app) self.app.config['DEFAULT_TIMEZONE'] = 'Australia/Sydney' self.app.data.insert( 'archive', [{ "place": [{ "qcode": "WA" }], "task": { "desk": ObjectId("5e1e9474d70421b46535ebe6"), "stage": ObjectId("5e1e9474d70421b46535ebe4") }, "headline": "Included 1", "slugline": "The links A", "subject": [{ "qcode": "15027000" }], "state": "submitted", "versioncreated": utcnow() - timedelta(hours=5), "body_html": "<p>LINKS A: somebody something</p>" }, { "place": [{ "qcode": "WA" }], "task": { "desk": ObjectId("5e1e9474d70421b46535ebe6"), "stage": ObjectId("5e1e9474d70421b46535ebe4") }, "headline": "Excluded due to slugline", "slugline": "Golf Results", "subject": [{ "qcode": "15027000" }], "state": "submitted", "versioncreated": utcnow() - timedelta(hours=5), "body_html": "<p>LINKS A: somebody something</p>" }, { "place": [{ "qcode": "WA" }], "task": { "desk": ObjectId("5e1e9474d70421b46535ebe6"), "stage": ObjectId("5e1e9474d70421b46535ebe4") }, "headline": "Excluded due to age", "slugline": "The links A", "subject": [{ "qcode": "15027000" }], "state": "submitted", "versioncreated": utcnow() - timedelta(hours=25), "body_html": "<p>LINKS A: somebody something</p>" }, { "place": [{ "qcode": "SA" }], "task": { "desk": ObjectId("5e1e9474d70421b46535ebe6"), "stage": ObjectId("5e1e9474d70421b46535ebe4") }, "headline": "Included 1", "slugline": "Echung", "subject": [{ "qcode": "15027000" }], "state": "submitted", "versioncreated": utcnow() - timedelta(hours=5), "body_html": "<p>ECHUNGA: somebody something</p>" }, { "place": [{ "qcode": "SA" }], "task": { "desk": ObjectId("5e1e9474d70421b46535ebe6"), "stage": ObjectId("5e1e9474d70421b46535ebe4") }, "headline": "Included 2", "slugline": "Gawler", "subject": [{ "qcode": "15027000" }], "state": "submitted", "versioncreated": utcnow() - timedelta(hours=5), "body_html": "<p>GAWLER: somebody something</p>" }, { "place": [{ "qcode": "SA" }], "task": { "desk": ObjectId("5e1e9474d70421b46535ebe6"), "stage": ObjectId("5e1e9474d70421b46535ebe4") }, "headline": "Included 3", "slugline": "Penola", "subject": [{ "qcode": "15027000" }], "state": "submitted", "versioncreated": utcnow() - timedelta(hours=5), "body_html": "<p>PENOLA: somebody something</p>" }, { "place": [{ "qcode": "SA" }], "task": { "desk": ObjectId("5e1e9474d70421b46535ebe6"), "stage": ObjectId("5e1e9474d70421b46535ebe4") }, "headline": "Excluded due to slugline", "slugline": "Golf Results", "subject": [{ "qcode": "15027000" }], "state": "submitted", "versioncreated": utcnow() - timedelta(hours=5), "body_html": "<p>LINKS A: somebody something</p>" }, { "place": [{ "qcode": "SA" }], "task": { "desk": ObjectId("5e1e9474d70421b46535ebe6"), "stage": ObjectId("5e1e9474d70421b46535ebe4") }, "headline": "Excluded due to age", "slugline": "The links A", "subject": [{ "qcode": "15027000" }], "state": "submitted", "versioncreated": utcnow() - timedelta(hours=25), "body_html": "<p>LINKS A: somebody something</p>" }]) self.app.data.insert('desks', [{ '_id': ObjectId("5e1e9474d70421b46535ebe6"), "name": "Copytakers" }, { '_id': ObjectId("123456789009876543221123"), "name": "Nothing to see here" }]) self.app.data.insert('stages', [{ "_id": ObjectId("5e1e9474d70421b46535ebe4"), "name": "Some Hold stage", "desk": ObjectId("5e1e9474d70421b46535ebe6") }, { "_id": ObjectId("abababababababababababab"), "name": "Nothing to see here", "desk": ObjectId("5e1e9474d70421b46535ebe6") }])
def setUp(self): with self.app.app_context(): init_app(self.app)
def setUp(self): self.app.data.insert('desks', self.desks) self.app.data.insert('vocabularies', self.vocab) init_app(self.app)
def setUp(self): super().setUp() with self.app.app_context(): self.app.data.insert('output_channels', self.output_channel) init_app(self.app)
def setUp(self): self.app.data.insert('subscribers', self.subscribers) self.app.data.insert('vocabularies', self.vocab) self.app.data.insert('desks', self.desks) self.app.data.insert('archive', self.pkg) init_app(self.app)
def setUp(self): self.formatter = MarketplaceNINJSFormatter() init_app(self.app) self.app.data.insert('ingest', self.ingest)
def setUp(self): super().setUp() self.app.data.insert("subscribers", self.subscribers) init_app(self.app)
def setUp(self): self.app.data.insert('desks', self.desks) init_app(self.app)
def setUp(self): vocabularies = [{ '_id': 'categories', 'display_name': 'Categories', 'type': 'manageable', 'items': [{ 'is_active': True, 'name': 'Australian General News', 'qcode': 'a' }, { 'is_active': True, 'name': 'Australian Weather', 'qcode': 'b', 'subject': '17000000' }, { 'is_active': True, 'name': 'General Features', 'qcode': 'c' }, { 'is_active': False, 'name': 'Reserved (obsolete/unused)', 'qcode': 'd' }, { 'is_active': True, 'name': 'Entertainment', 'qcode': 'e', 'subject': '01000000' }, { 'is_active': True, 'name': 'Finance', 'qcode': 'f', 'subject': '04000000' }, { 'is_active': False, 'name': 'SportSet', 'qcode': 'g' }, { 'is_active': True, 'name': 'FormGuide', 'qcode': 'h' }, { 'is_active': True, 'name': 'International News', 'qcode': 'i' }, { 'is_active': False, 'name': 'Reserved (obsolete/unused)', 'qcode': 'k' }, { 'is_active': True, 'name': 'Press Release Service', 'qcode': 'j' }, { 'is_active': True, 'name': 'Lotteries', 'qcode': 'l' }, { 'is_active': True, 'name': 'Line Check Messages', 'qcode': 'm' }, { 'is_active': False, 'name': 'Reserved', 'qcode': 'n' }, { 'is_active': True, 'name': 'State Parliaments', 'qcode': 'o', 'subject': '11000000' }, { 'is_active': True, 'name': 'Federal Parliament', 'qcode': 'p', 'subject': '11000000' }, { 'is_active': True, 'name': 'Stockset', 'qcode': 'q', 'subject': '04000000' }, { 'is_active': True, 'name': 'Racing (Turf)', 'qcode': 'r', 'subject': '15000000' }, { 'is_active': True, 'name': 'Overseas Sport', 'qcode': 's', 'subject': '15000000' }, { 'is_active': True, 'name': 'Domestic Sport', 'qcode': 't', 'subject': '15000000' }, { 'is_active': False, 'name': 'Reserved (Obsolete/unused)', 'qcode': 'u' }, { 'is_active': True, 'name': 'Advisories', 'qcode': 'v' }, { 'is_active': False, 'name': 'Reserved (Obsolete/unused)', 'qcode': 'w' }, { 'is_active': True, 'name': 'Special Events (olympics/ Aus elections)', 'qcode': 'x' }, { 'is_active': False, 'name': 'Special Events (obsolete/unused)', 'qcode': 'y' }, { 'is_active': False, 'name': 'Supplementary Traffic', 'qcode': 'z' }] }] self.app.data.insert('vocabularies', vocabularies) init_app(self.app)
def setUp(self): super().setUp() self.app.data.insert('subscribers', self.subscribers) self.app.data.insert('vocabularies', self.vocab) self.app.data.insert('desks', self.desks) init_app(self.app)
def setUp(self): super().setUp() self.app.data.insert('desks', self.desks) init_app(self.app)
def setUp(self): super().setUp() with self.app.app_context(): self.app.data.insert('subscribers', self.subscribers) init_app(self.app)
def setUp(self): super().setUp() self.formatter = NINJSFormatter() init_app(self.app)
def setUp(self): super().setUp() self.app.data.insert('subscribers', self.subscribers) init_app(self.app)
def setUp(self): init_app(self.app) self.app.data.insert('archive', [{'_id': 1}])
def setUp(self): super().setUp() self.app.data.insert('desks', self.desks) self.app.data.insert('vocabularies', self.vocab) init_app(self.app)
def setUp(self): super().setUp() with self.app.app_context(): init_app(self.app)