'Testing the dump / load with full dump of file content data'

def test_dump_load_data_content(self):

    with SettingsOverride(filer_settings, FILER_DUMP_PAYLOAD=True):
        create_folder_structure(1, 1)
        fileobj = self.create_filer_file(Folder.objects.all()[0])
        jdata = StringIO()
        fobj = tempfile.NamedTemporaryFile(suffix=u'.json', delete=False)
        call_command(u'dumpdata', u'filer', stdout=jdata, indent=3)
        complete = os.path.join(fileobj.file.storage.location, fileobj.path)
        os.unlink(complete)
        fileobj.delete()
        fobj.write(jdata.getvalue().encode(u'utf-8'))
        fobj.seek(0)
        call_command(u'loaddata', fobj.name, stdout=jdata)
        self.assertEqual(Folder.objects.all().count(), 1)
        self.assertEqual(File.objects.all().count(), 1)
        self.assertEqual(File.objects.all()[0].original_filename, self.image_name)
        fileobj = File.objects.all()[0]
        complete = os.path.join(fileobj.file.storage.location, fileobj.path)
        self.assertTrue(os.path.exists(complete))
