Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
django文件管理器:未保存文件模型;改为引发非类型错误。为什么?_Django_Error Handling_Django Filer - Fatal编程技术网

django文件管理器:未保存文件模型;改为引发非类型错误。为什么?

django文件管理器:未保存文件模型;改为引发非类型错误。为什么?,django,error-handling,django-filer,Django,Error Handling,Django Filer,嗨,我正在尝试测试模拟django文件管理器save()触发post\u save信号 型号.py import filer.fields.file import FilerFileField 类别交货发票(TimeStampedModel): 发票\u excel=FilerFileField(null=True,blank=True) 测试.py 从filer.models.filemodels将文件作为FilerFile导入 从django.core.files导入文件 def测试\u如

嗨,我正在尝试测试模拟django文件管理器
save()
触发
post\u save
信号

型号.py

import filer.fields.file import FilerFileField
类别交货发票(TimeStampedModel):
发票\u excel=FilerFileField(null=True,blank=True)
测试.py

从filer.models.filemodels将文件作为FilerFile导入
从django.core.files导入文件
def测试\u如果\u交付\u发票\u编号\u更新\u文件\u保存\u通过\u管理员(自我):
使用补丁(“orders.utils.apply_invoice_number_to_orders”)作为信号模拟处理程序:
post\u save.connect(信号\u模拟\u处理程序,发送方=发货发票)
文件名='test\u invoice\u excel'
文件路径='orders/fixture/delivery_invoices.xlsx'
将open(filepath,'rb')作为f:
file_obj=file(f,name=filename)
错误->发票\u excel=FilerFile.objects.create(所有者=self.user,文件=file\u obj,原始文件名=filename)
实例=发货发票(发票\u excel=发票\u excel)
save()实例
assertTrue(signal\u mock\u handler.called)
错误消息

....
File "/Users/mhjeon/.pyenv/versions/3.6.0/envs/modernlab/lib/python3.6/site-packages/boto/auth.py", line 1070, in _wrapper
if test in self.host:

TypeError: argument of type 'NoneType' is not iterable
这段代码几天前还可以工作,但经过一些我认为与orders模型无关的代码重构后,它突然无法调用django文件管理器的FilerModel.save()方法。 有什么不对劲吗/