Example #1
0
    def setUp(self):
        super(ExportChannelTestCase, self).setUp()
        self.content_channel = channel()

        # Add some incomplete nodes to ensure they don't get published.
        new_node = create_node({'kind_id': 'topic', 'title': 'Incomplete topic', 'children': []})
        new_node.complete = False
        new_node.parent = self.content_channel.main_tree
        new_node.save()

        new_video = create_node({'kind_id': 'video', 'title': 'Incomplete video', 'children': []})
        new_video.complete = False
        new_video.parent = new_node
        new_video.save()

        # Add a complete node within an incomplete node to ensure it's excluded.
        new_video = create_node({'kind_id': 'video', 'title': 'Complete video', 'children': []})
        new_video.complete = True
        new_video.parent = new_node
        new_video.save()

        set_channel_icon_encoding(self.content_channel)
        self.tempdb = create_content_database(self.content_channel, True, None, True)

        set_active_content_database(self.tempdb)
Example #2
0
 def tearDown(self):
     super(ExportChannelTestCase, self).tearDown()
     set_active_content_database(None)
     if os.path.exists(self.tempdb):
         os.remove(self.tempdb)
Example #3
0
 def setUp(self):
     super(ChannelExportPrerequisiteTestCase, self).setUp()
     fh, output_db = tempfile.mkstemp(suffix=".sqlite3")
     self.output_db = output_db
     set_active_content_database(self.output_db)
     prepare_export_database(self.output_db)
Example #4
0
 def tearDown(self):
     super(ChannelExportPrerequisiteTestCase, self).tearDown()
     set_active_content_database(None)
     if os.path.exists(self.output_db):
         os.remove(self.output_db)
Example #5
0
 def tearDown(self):
     super(ChannelExportUtilityFunctionTestCase, self).tearDown()
     set_active_content_database(None)
     if os.path.exists(self.output_db):
         os.remove(self.output_db)