def test_export(self):

        res =  export_file(self.all(),
                            [dict(header='Filename', field='id'),
                             dict(header='Description',field="description")],
                            None)
        self.assertIn("test1.mp4,summary1 blah", res)
        self.assertIn('test2.mp4,"summary2, blah"', res)
    def test_export(self):

        res = export_file(self.all(), [
            dict(header='Filename', field='id'),
            dict(header='Description', field="description")
        ], None)
        self.assertIn("test1.mp4,summary1 blah", res)
        self.assertIn('test2.mp4,"summary2, blah"', res)
    def test_date(self):
        dexterity_import(self.target,
                         """filename,date\ntest1,10/10/2015""",
                         dict(filename='id', date="effective"),
                         object_type="Document",
                         create_new=True,
                         primary_key='id')

        res =  export_file(self.all(),
                            [dict(header='Filename', field='id'),
                             dict(header='date',field="effective")],
                            None)
        self.assertIn("test1,2015-10-10 00:00:00", res)
    def test_date(self):
        dexterity_import(self.target,
                         """filename,date\ntest1,10/10/2015""",
                         dict(filename='id', date="effective"),
                         object_type="Document",
                         create_new=True,
                         primary_key='id')

        res = export_file(self.all(), [
            dict(header='Filename', field='id'),
            dict(header='date', field="effective")
        ], None)
        self.assertIn("test1,2015-10-10 00:00:00", res)
 def test_url(self):
     res =  export_file(self.all(),
                         [dict(header='Filename', field='id'),
                          dict(header='URL',field="_url")],
                         None)
     self.assertIn("test1.mp4,http://nohost/plone/target/test1.mp4", res)
 def test_url(self):
     res = export_file(self.all(), [
         dict(header='Filename', field='id'),
         dict(header='URL', field="_url")
     ], None)
     self.assertIn("test1.mp4,http://nohost/plone/target/test1.mp4", res)