Advertisement
Guest User

Untitled

a guest
Nov 15th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 98.06 KB | None | 0 0
  1. (ikura) [vagrant@localhost ikura]$ py.test apps/retail/tests/test_excel.py
  2. ============================================================================================================================== test session starts ===============================================================================================================================
  3. platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
  4. django settings: project_core.settings (from ini file)
  5. rootdir: /webroot/ikura, inifile: setup.cfg
  6. plugins: flake8-0.6, django-2.9.1, cov-2.2.1
  7. collected 33 items
  8.  
  9. apps/retail/tests/test_excel.py s................FFFFFFFFFFFFssFF
  10. ----------------------------------------------------------------------------------------------------------------- coverage: platform linux, python 3.5.1-final-0 -----------------------------------------------------------------------------------------------------------------
  11. Name Stmts Miss Branch BrPart Cover Missing
  12. ------------------------------------------------------------------------------------------------
  13. apps/__init__.py 0 0 0 0 100%
  14. apps/pricing/__init__.py 0 0 0 0 100%
  15. apps/pricing/formulas/__init__.py 4 0 0 0 100%
  16. apps/pricing/formulas/base.py 282 198 70 0 24% 22-24, 33-35, 60, 80-93, 108-115, 135-154, 205-209, 212, 227-240, 290-294, 297, 312-322, 361-363, 366, 381-389, 452-456, 459, 474-485, 488-495, 553-558, 561, 576-585, 635-641, 644, 658-673, 758-767, 770, 783-788, 792, 796, 800, 811-813, 816, 820, 824, 828, 832, 835-840, 843-848, 852, 857, 862-864, 869-871, 877, 886-893, 961-965, 970, 983-995, 1000, 1005, 1050-1052, 1055, 1060-1065, 1070-1072
  17. apps/pricing/formulas/calculations.py 25 20 0 0 20% 23-41, 47-65, 71-95, 101-135
  18. apps/pricing/formulas/runner.py 34 28 10 0 14% 50, 60-65, 76-95, 98-108, 111-115
  19. apps/pricing/management/__init__.py 0 0 0 0 100%
  20. apps/pricing/management/commands/__init__.py 0 0 0 0 100%
  21. apps/pricing/management/commands/add_test_users.py 29 29 8 0 0% 3-93
  22. apps/pricing/models/__init__.py 0 0 0 0 100%
  23. apps/pricing/models/enums.py 6 0 0 0 100%
  24. apps/pricing/models/mixins.py 5 0 0 0 100%
  25. apps/retail/__init__.py 0 0 0 0 100%
  26. apps/retail/admin.py 27 0 16 0 100%
  27. apps/retail/constants.py 43 0 0 0 100%
  28. apps/retail/excel.py 172 122 24 0 31% 206-230, 253-271, 287-290, 299-353, 361-446, 454
  29. apps/retail/forms.py 132 132 40 0 0% 1-535
  30. apps/retail/formulas.py 51 51 0 0 0% 7-203
  31. apps/retail/mixins.py 103 103 36 0 0% 12-250
  32. apps/retail/models/__init__.py 2 0 0 0 100%
  33. apps/retail/models/price_changes.py 174 67 18 0 58% 83-94, 97, 100-115, 442-449, 489-493, 501-527, 535-560, 568-596
  34. apps/retail/models/upload_and_download.py 51 12 0 0 76% 70-72, 99-100, 131, 134-135, 149-152
  35. apps/retail/templatetags/__init__.py 0 0 0 0 100%
  36. apps/retail/templatetags/custom_pagination.py 16 16 8 0 0% 3-41
  37. apps/retail/templatetags/search.py 12 12 2 0 0% 1-31
  38. apps/retail/urls.py 3 3 0 0 0% 1-16
  39. apps/retail/views.py 345 345 93 0 0% 1-776
  40. apps/utils/__init__.py 0 0 0 0 100%
  41. apps/utils/excel_utils.py 16 0 6 0 100%
  42. apps/utils/models.py 9 0 4 1 92% 33->29
  43. ------------------------------------------------------------------------------------------------
  44. TOTAL 1541 1138 335 1 24%
  45.  
  46. ==================================================================================================================================== FAILURES ====================================================================================================================================
  47. __________________________________________________________________________________________________________________ XlsxwriterWriterTests.test_cell_format_color __________________________________________________________________________________________________________________
  48.  
  49. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_cell_format_color>
  50.  
  51. def setUp(self):
  52. self.filename = None
  53. self.display_name = 'test'
  54.  
  55. self.user = User.objects.create_user(
  56. username='test',
  57. password='password123',
  58. email='test@example.com'
  59. )
  60.  
  61. > self.rows = self._create_test_data()
  62.  
  63. apps/retail/tests/test_excel.py:200:
  64. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  65. apps/retail/tests/test_excel.py:222: in _create_test_data
  66. **rsd_data
  67. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  68. return getattr(self.get_queryset(), name)(*args, **kwargs)
  69. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  70. obj = self.model(**kwargs)
  71. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  72.  
  73. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa492a33ef0>, val = ''
  74. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  75.  
  76. def __init__(self, *args, **kwargs):
  77. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  78.  
  79. # Set up the storage for instance state
  80. self._state = ModelState()
  81.  
  82. # There is a rather weird disparity here; if kwargs, it's set, then args
  83. # overrides it. It should be one or the other; don't duplicate the work
  84. # The reason for the kwargs check is that standard iterator passes in by
  85. # args, and instantiation for iteration is 33% faster.
  86. args_len = len(args)
  87. if args_len > len(self._meta.concrete_fields):
  88. # Daft, but matches old exception sans the err msg.
  89. raise IndexError("Number of args exceeds number of fields")
  90.  
  91. if not kwargs:
  92. fields_iter = iter(self._meta.concrete_fields)
  93. # The ordering of the zip calls matter - zip throws StopIteration
  94. # when an iter throws it. So if the first iter throws it, the second
  95. # is *not* consumed. We rely on this, so don't change the order
  96. # without changing the logic.
  97. for val, field in zip(args, fields_iter):
  98. setattr(self, field.attname, val)
  99. else:
  100. # Slower, kwargs-ready version.
  101. fields_iter = iter(self._meta.fields)
  102. for val, field in zip(args, fields_iter):
  103. setattr(self, field.attname, val)
  104. kwargs.pop(field.name, None)
  105. # Maintain compatibility with existing calls.
  106. if isinstance(field.remote_field, ManyToOneRel):
  107. kwargs.pop(field.attname, None)
  108.  
  109. # Now we're left with the unprocessed fields that *must* come from
  110. # keywords, or default.
  111.  
  112. for field in fields_iter:
  113. is_related_object = False
  114. # This slightly odd construct is so that we can access any
  115. # data-descriptor object (DeferredAttribute) without triggering its
  116. # __get__ method.
  117. if (field.attname not in kwargs and
  118. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  119. or field.column is None)):
  120. # This field will be populated on request.
  121. continue
  122. if kwargs:
  123. if isinstance(field.remote_field, ForeignObjectRel):
  124. try:
  125. # Assume object instance was passed in.
  126. rel_obj = kwargs.pop(field.name)
  127. is_related_object = True
  128. except KeyError:
  129. try:
  130. # Object instance wasn't passed in -- must be an ID.
  131. val = kwargs.pop(field.attname)
  132. except KeyError:
  133. val = field.get_default()
  134. else:
  135. # Object instance was passed in. Special case: You can
  136. # pass in "None" for related objects if it's allowed.
  137. if rel_obj is None and field.null:
  138. val = None
  139. else:
  140. try:
  141. val = kwargs.pop(field.attname)
  142. except KeyError:
  143. # This is done with an exception rather than the
  144. # default argument on pop because we don't want
  145. # get_default() to be evaluated, and then not used.
  146. # Refs #12057.
  147. val = field.get_default()
  148. else:
  149. val = field.get_default()
  150.  
  151. if is_related_object:
  152. # If we are passed a related instance, set it using the
  153. # field.name instead of field.attname (e.g. "user" instead of
  154. # "user_id") so that the object gets properly cached (and type
  155. # checked) by the RelatedObjectDescriptor.
  156. setattr(self, field.name, rel_obj)
  157. else:
  158. setattr(self, field.attname, val)
  159.  
  160. if kwargs:
  161. for prop in list(kwargs):
  162. try:
  163. if isinstance(getattr(self.__class__, prop), property):
  164. setattr(self, prop, kwargs.pop(prop))
  165. except AttributeError:
  166. pass
  167. if kwargs:
  168. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  169. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  170.  
  171. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  172. ___________________________________________________________________________________________________________________ XlsxwriterWriterTests.test_currency_format ___________________________________________________________________________________________________________________
  173.  
  174. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_currency_format>
  175.  
  176. def setUp(self):
  177. self.filename = None
  178. self.display_name = 'test'
  179.  
  180. self.user = User.objects.create_user(
  181. username='test',
  182. password='password123',
  183. email='test@example.com'
  184. )
  185.  
  186. > self.rows = self._create_test_data()
  187.  
  188. apps/retail/tests/test_excel.py:200:
  189. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  190. apps/retail/tests/test_excel.py:222: in _create_test_data
  191. **rsd_data
  192. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  193. return getattr(self.get_queryset(), name)(*args, **kwargs)
  194. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  195. obj = self.model(**kwargs)
  196. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  197.  
  198. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa4928e0dd8>, val = ''
  199. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  200.  
  201. def __init__(self, *args, **kwargs):
  202. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  203.  
  204. # Set up the storage for instance state
  205. self._state = ModelState()
  206.  
  207. # There is a rather weird disparity here; if kwargs, it's set, then args
  208. # overrides it. It should be one or the other; don't duplicate the work
  209. # The reason for the kwargs check is that standard iterator passes in by
  210. # args, and instantiation for iteration is 33% faster.
  211. args_len = len(args)
  212. if args_len > len(self._meta.concrete_fields):
  213. # Daft, but matches old exception sans the err msg.
  214. raise IndexError("Number of args exceeds number of fields")
  215.  
  216. if not kwargs:
  217. fields_iter = iter(self._meta.concrete_fields)
  218. # The ordering of the zip calls matter - zip throws StopIteration
  219. # when an iter throws it. So if the first iter throws it, the second
  220. # is *not* consumed. We rely on this, so don't change the order
  221. # without changing the logic.
  222. for val, field in zip(args, fields_iter):
  223. setattr(self, field.attname, val)
  224. else:
  225. # Slower, kwargs-ready version.
  226. fields_iter = iter(self._meta.fields)
  227. for val, field in zip(args, fields_iter):
  228. setattr(self, field.attname, val)
  229. kwargs.pop(field.name, None)
  230. # Maintain compatibility with existing calls.
  231. if isinstance(field.remote_field, ManyToOneRel):
  232. kwargs.pop(field.attname, None)
  233.  
  234. # Now we're left with the unprocessed fields that *must* come from
  235. # keywords, or default.
  236.  
  237. for field in fields_iter:
  238. is_related_object = False
  239. # This slightly odd construct is so that we can access any
  240. # data-descriptor object (DeferredAttribute) without triggering its
  241. # __get__ method.
  242. if (field.attname not in kwargs and
  243. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  244. or field.column is None)):
  245. # This field will be populated on request.
  246. continue
  247. if kwargs:
  248. if isinstance(field.remote_field, ForeignObjectRel):
  249. try:
  250. # Assume object instance was passed in.
  251. rel_obj = kwargs.pop(field.name)
  252. is_related_object = True
  253. except KeyError:
  254. try:
  255. # Object instance wasn't passed in -- must be an ID.
  256. val = kwargs.pop(field.attname)
  257. except KeyError:
  258. val = field.get_default()
  259. else:
  260. # Object instance was passed in. Special case: You can
  261. # pass in "None" for related objects if it's allowed.
  262. if rel_obj is None and field.null:
  263. val = None
  264. else:
  265. try:
  266. val = kwargs.pop(field.attname)
  267. except KeyError:
  268. # This is done with an exception rather than the
  269. # default argument on pop because we don't want
  270. # get_default() to be evaluated, and then not used.
  271. # Refs #12057.
  272. val = field.get_default()
  273. else:
  274. val = field.get_default()
  275.  
  276. if is_related_object:
  277. # If we are passed a related instance, set it using the
  278. # field.name instead of field.attname (e.g. "user" instead of
  279. # "user_id") so that the object gets properly cached (and type
  280. # checked) by the RelatedObjectDescriptor.
  281. setattr(self, field.name, rel_obj)
  282. else:
  283. setattr(self, field.attname, val)
  284.  
  285. if kwargs:
  286. for prop in list(kwargs):
  287. try:
  288. if isinstance(getattr(self.__class__, prop), property):
  289. setattr(self, prop, kwargs.pop(prop))
  290. except AttributeError:
  291. pass
  292. if kwargs:
  293. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  294. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  295.  
  296. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  297. ______________________________________________________________________________________________________________ XlsxwriterWriterTests.test_default_cell_format_color ______________________________________________________________________________________________________________
  298.  
  299. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_default_cell_format_color>
  300.  
  301. def setUp(self):
  302. self.filename = None
  303. self.display_name = 'test'
  304.  
  305. self.user = User.objects.create_user(
  306. username='test',
  307. password='password123',
  308. email='test@example.com'
  309. )
  310.  
  311. > self.rows = self._create_test_data()
  312.  
  313. apps/retail/tests/test_excel.py:200:
  314. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  315. apps/retail/tests/test_excel.py:222: in _create_test_data
  316. **rsd_data
  317. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  318. return getattr(self.get_queryset(), name)(*args, **kwargs)
  319. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  320. obj = self.model(**kwargs)
  321. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  322.  
  323. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa49373a208>, val = ''
  324. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  325.  
  326. def __init__(self, *args, **kwargs):
  327. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  328.  
  329. # Set up the storage for instance state
  330. self._state = ModelState()
  331.  
  332. # There is a rather weird disparity here; if kwargs, it's set, then args
  333. # overrides it. It should be one or the other; don't duplicate the work
  334. # The reason for the kwargs check is that standard iterator passes in by
  335. # args, and instantiation for iteration is 33% faster.
  336. args_len = len(args)
  337. if args_len > len(self._meta.concrete_fields):
  338. # Daft, but matches old exception sans the err msg.
  339. raise IndexError("Number of args exceeds number of fields")
  340.  
  341. if not kwargs:
  342. fields_iter = iter(self._meta.concrete_fields)
  343. # The ordering of the zip calls matter - zip throws StopIteration
  344. # when an iter throws it. So if the first iter throws it, the second
  345. # is *not* consumed. We rely on this, so don't change the order
  346. # without changing the logic.
  347. for val, field in zip(args, fields_iter):
  348. setattr(self, field.attname, val)
  349. else:
  350. # Slower, kwargs-ready version.
  351. fields_iter = iter(self._meta.fields)
  352. for val, field in zip(args, fields_iter):
  353. setattr(self, field.attname, val)
  354. kwargs.pop(field.name, None)
  355. # Maintain compatibility with existing calls.
  356. if isinstance(field.remote_field, ManyToOneRel):
  357. kwargs.pop(field.attname, None)
  358.  
  359. # Now we're left with the unprocessed fields that *must* come from
  360. # keywords, or default.
  361.  
  362. for field in fields_iter:
  363. is_related_object = False
  364. # This slightly odd construct is so that we can access any
  365. # data-descriptor object (DeferredAttribute) without triggering its
  366. # __get__ method.
  367. if (field.attname not in kwargs and
  368. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  369. or field.column is None)):
  370. # This field will be populated on request.
  371. continue
  372. if kwargs:
  373. if isinstance(field.remote_field, ForeignObjectRel):
  374. try:
  375. # Assume object instance was passed in.
  376. rel_obj = kwargs.pop(field.name)
  377. is_related_object = True
  378. except KeyError:
  379. try:
  380. # Object instance wasn't passed in -- must be an ID.
  381. val = kwargs.pop(field.attname)
  382. except KeyError:
  383. val = field.get_default()
  384. else:
  385. # Object instance was passed in. Special case: You can
  386. # pass in "None" for related objects if it's allowed.
  387. if rel_obj is None and field.null:
  388. val = None
  389. else:
  390. try:
  391. val = kwargs.pop(field.attname)
  392. except KeyError:
  393. # This is done with an exception rather than the
  394. # default argument on pop because we don't want
  395. # get_default() to be evaluated, and then not used.
  396. # Refs #12057.
  397. val = field.get_default()
  398. else:
  399. val = field.get_default()
  400.  
  401. if is_related_object:
  402. # If we are passed a related instance, set it using the
  403. # field.name instead of field.attname (e.g. "user" instead of
  404. # "user_id") so that the object gets properly cached (and type
  405. # checked) by the RelatedObjectDescriptor.
  406. setattr(self, field.name, rel_obj)
  407. else:
  408. setattr(self, field.attname, val)
  409.  
  410. if kwargs:
  411. for prop in list(kwargs):
  412. try:
  413. if isinstance(getattr(self.__class__, prop), property):
  414. setattr(self, prop, kwargs.pop(prop))
  415. except AttributeError:
  416. pass
  417. if kwargs:
  418. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  419. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  420.  
  421. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  422. ____________________________________________________________________________________________________________________ XlsxwriterWriterTests.test_elp_event_dec ____________________________________________________________________________________________________________________
  423.  
  424. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_elp_event_dec>
  425.  
  426. def setUp(self):
  427. self.filename = None
  428. self.display_name = 'test'
  429.  
  430. self.user = User.objects.create_user(
  431. username='test',
  432. password='password123',
  433. email='test@example.com'
  434. )
  435.  
  436. > self.rows = self._create_test_data()
  437.  
  438. apps/retail/tests/test_excel.py:200:
  439. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  440. apps/retail/tests/test_excel.py:222: in _create_test_data
  441. **rsd_data
  442. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  443. return getattr(self.get_queryset(), name)(*args, **kwargs)
  444. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  445. obj = self.model(**kwargs)
  446. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  447.  
  448. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa49206c518>, val = ''
  449. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  450.  
  451. def __init__(self, *args, **kwargs):
  452. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  453.  
  454. # Set up the storage for instance state
  455. self._state = ModelState()
  456.  
  457. # There is a rather weird disparity here; if kwargs, it's set, then args
  458. # overrides it. It should be one or the other; don't duplicate the work
  459. # The reason for the kwargs check is that standard iterator passes in by
  460. # args, and instantiation for iteration is 33% faster.
  461. args_len = len(args)
  462. if args_len > len(self._meta.concrete_fields):
  463. # Daft, but matches old exception sans the err msg.
  464. raise IndexError("Number of args exceeds number of fields")
  465.  
  466. if not kwargs:
  467. fields_iter = iter(self._meta.concrete_fields)
  468. # The ordering of the zip calls matter - zip throws StopIteration
  469. # when an iter throws it. So if the first iter throws it, the second
  470. # is *not* consumed. We rely on this, so don't change the order
  471. # without changing the logic.
  472. for val, field in zip(args, fields_iter):
  473. setattr(self, field.attname, val)
  474. else:
  475. # Slower, kwargs-ready version.
  476. fields_iter = iter(self._meta.fields)
  477. for val, field in zip(args, fields_iter):
  478. setattr(self, field.attname, val)
  479. kwargs.pop(field.name, None)
  480. # Maintain compatibility with existing calls.
  481. if isinstance(field.remote_field, ManyToOneRel):
  482. kwargs.pop(field.attname, None)
  483.  
  484. # Now we're left with the unprocessed fields that *must* come from
  485. # keywords, or default.
  486.  
  487. for field in fields_iter:
  488. is_related_object = False
  489. # This slightly odd construct is so that we can access any
  490. # data-descriptor object (DeferredAttribute) without triggering its
  491. # __get__ method.
  492. if (field.attname not in kwargs and
  493. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  494. or field.column is None)):
  495. # This field will be populated on request.
  496. continue
  497. if kwargs:
  498. if isinstance(field.remote_field, ForeignObjectRel):
  499. try:
  500. # Assume object instance was passed in.
  501. rel_obj = kwargs.pop(field.name)
  502. is_related_object = True
  503. except KeyError:
  504. try:
  505. # Object instance wasn't passed in -- must be an ID.
  506. val = kwargs.pop(field.attname)
  507. except KeyError:
  508. val = field.get_default()
  509. else:
  510. # Object instance was passed in. Special case: You can
  511. # pass in "None" for related objects if it's allowed.
  512. if rel_obj is None and field.null:
  513. val = None
  514. else:
  515. try:
  516. val = kwargs.pop(field.attname)
  517. except KeyError:
  518. # This is done with an exception rather than the
  519. # default argument on pop because we don't want
  520. # get_default() to be evaluated, and then not used.
  521. # Refs #12057.
  522. val = field.get_default()
  523. else:
  524. val = field.get_default()
  525.  
  526. if is_related_object:
  527. # If we are passed a related instance, set it using the
  528. # field.name instead of field.attname (e.g. "user" instead of
  529. # "user_id") so that the object gets properly cached (and type
  530. # checked) by the RelatedObjectDescriptor.
  531. setattr(self, field.name, rel_obj)
  532. else:
  533. setattr(self, field.attname, val)
  534.  
  535. if kwargs:
  536. for prop in list(kwargs):
  537. try:
  538. if isinstance(getattr(self.__class__, prop), property):
  539. setattr(self, prop, kwargs.pop(prop))
  540. except AttributeError:
  541. pass
  542. if kwargs:
  543. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  544. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  545.  
  546. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  547. ____________________________________________________________________________________________________________________ XlsxwriterWriterTests.test_elp_event_inc ____________________________________________________________________________________________________________________
  548.  
  549. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_elp_event_inc>
  550.  
  551. def setUp(self):
  552. self.filename = None
  553. self.display_name = 'test'
  554.  
  555. self.user = User.objects.create_user(
  556. username='test',
  557. password='password123',
  558. email='test@example.com'
  559. )
  560.  
  561. > self.rows = self._create_test_data()
  562.  
  563. apps/retail/tests/test_excel.py:200:
  564. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  565. apps/retail/tests/test_excel.py:222: in _create_test_data
  566. **rsd_data
  567. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  568. return getattr(self.get_queryset(), name)(*args, **kwargs)
  569. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  570. obj = self.model(**kwargs)
  571. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  572.  
  573. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa4937edeb8>, val = ''
  574. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  575.  
  576. def __init__(self, *args, **kwargs):
  577. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  578.  
  579. # Set up the storage for instance state
  580. self._state = ModelState()
  581.  
  582. # There is a rather weird disparity here; if kwargs, it's set, then args
  583. # overrides it. It should be one or the other; don't duplicate the work
  584. # The reason for the kwargs check is that standard iterator passes in by
  585. # args, and instantiation for iteration is 33% faster.
  586. args_len = len(args)
  587. if args_len > len(self._meta.concrete_fields):
  588. # Daft, but matches old exception sans the err msg.
  589. raise IndexError("Number of args exceeds number of fields")
  590.  
  591. if not kwargs:
  592. fields_iter = iter(self._meta.concrete_fields)
  593. # The ordering of the zip calls matter - zip throws StopIteration
  594. # when an iter throws it. So if the first iter throws it, the second
  595. # is *not* consumed. We rely on this, so don't change the order
  596. # without changing the logic.
  597. for val, field in zip(args, fields_iter):
  598. setattr(self, field.attname, val)
  599. else:
  600. # Slower, kwargs-ready version.
  601. fields_iter = iter(self._meta.fields)
  602. for val, field in zip(args, fields_iter):
  603. setattr(self, field.attname, val)
  604. kwargs.pop(field.name, None)
  605. # Maintain compatibility with existing calls.
  606. if isinstance(field.remote_field, ManyToOneRel):
  607. kwargs.pop(field.attname, None)
  608.  
  609. # Now we're left with the unprocessed fields that *must* come from
  610. # keywords, or default.
  611.  
  612. for field in fields_iter:
  613. is_related_object = False
  614. # This slightly odd construct is so that we can access any
  615. # data-descriptor object (DeferredAttribute) without triggering its
  616. # __get__ method.
  617. if (field.attname not in kwargs and
  618. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  619. or field.column is None)):
  620. # This field will be populated on request.
  621. continue
  622. if kwargs:
  623. if isinstance(field.remote_field, ForeignObjectRel):
  624. try:
  625. # Assume object instance was passed in.
  626. rel_obj = kwargs.pop(field.name)
  627. is_related_object = True
  628. except KeyError:
  629. try:
  630. # Object instance wasn't passed in -- must be an ID.
  631. val = kwargs.pop(field.attname)
  632. except KeyError:
  633. val = field.get_default()
  634. else:
  635. # Object instance was passed in. Special case: You can
  636. # pass in "None" for related objects if it's allowed.
  637. if rel_obj is None and field.null:
  638. val = None
  639. else:
  640. try:
  641. val = kwargs.pop(field.attname)
  642. except KeyError:
  643. # This is done with an exception rather than the
  644. # default argument on pop because we don't want
  645. # get_default() to be evaluated, and then not used.
  646. # Refs #12057.
  647. val = field.get_default()
  648. else:
  649. val = field.get_default()
  650.  
  651. if is_related_object:
  652. # If we are passed a related instance, set it using the
  653. # field.name instead of field.attname (e.g. "user" instead of
  654. # "user_id") so that the object gets properly cached (and type
  655. # checked) by the RelatedObjectDescriptor.
  656. setattr(self, field.name, rel_obj)
  657. else:
  658. setattr(self, field.attname, val)
  659.  
  660. if kwargs:
  661. for prop in list(kwargs):
  662. try:
  663. if isinstance(getattr(self.__class__, prop), property):
  664. setattr(self, prop, kwargs.pop(prop))
  665. except AttributeError:
  666. pass
  667. if kwargs:
  668. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  669. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  670.  
  671. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  672. ___________________________________________________________________________________________________________________ XlsxwriterWriterTests.test_elp_event_none ____________________________________________________________________________________________________________________
  673.  
  674. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_elp_event_none>
  675.  
  676. def setUp(self):
  677. self.filename = None
  678. self.display_name = 'test'
  679.  
  680. self.user = User.objects.create_user(
  681. username='test',
  682. password='password123',
  683. email='test@example.com'
  684. )
  685.  
  686. > self.rows = self._create_test_data()
  687.  
  688. apps/retail/tests/test_excel.py:200:
  689. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  690. apps/retail/tests/test_excel.py:222: in _create_test_data
  691. **rsd_data
  692. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  693. return getattr(self.get_queryset(), name)(*args, **kwargs)
  694. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  695. obj = self.model(**kwargs)
  696. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  697.  
  698. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa4928c0cf8>, val = ''
  699. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  700.  
  701. def __init__(self, *args, **kwargs):
  702. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  703.  
  704. # Set up the storage for instance state
  705. self._state = ModelState()
  706.  
  707. # There is a rather weird disparity here; if kwargs, it's set, then args
  708. # overrides it. It should be one or the other; don't duplicate the work
  709. # The reason for the kwargs check is that standard iterator passes in by
  710. # args, and instantiation for iteration is 33% faster.
  711. args_len = len(args)
  712. if args_len > len(self._meta.concrete_fields):
  713. # Daft, but matches old exception sans the err msg.
  714. raise IndexError("Number of args exceeds number of fields")
  715.  
  716. if not kwargs:
  717. fields_iter = iter(self._meta.concrete_fields)
  718. # The ordering of the zip calls matter - zip throws StopIteration
  719. # when an iter throws it. So if the first iter throws it, the second
  720. # is *not* consumed. We rely on this, so don't change the order
  721. # without changing the logic.
  722. for val, field in zip(args, fields_iter):
  723. setattr(self, field.attname, val)
  724. else:
  725. # Slower, kwargs-ready version.
  726. fields_iter = iter(self._meta.fields)
  727. for val, field in zip(args, fields_iter):
  728. setattr(self, field.attname, val)
  729. kwargs.pop(field.name, None)
  730. # Maintain compatibility with existing calls.
  731. if isinstance(field.remote_field, ManyToOneRel):
  732. kwargs.pop(field.attname, None)
  733.  
  734. # Now we're left with the unprocessed fields that *must* come from
  735. # keywords, or default.
  736.  
  737. for field in fields_iter:
  738. is_related_object = False
  739. # This slightly odd construct is so that we can access any
  740. # data-descriptor object (DeferredAttribute) without triggering its
  741. # __get__ method.
  742. if (field.attname not in kwargs and
  743. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  744. or field.column is None)):
  745. # This field will be populated on request.
  746. continue
  747. if kwargs:
  748. if isinstance(field.remote_field, ForeignObjectRel):
  749. try:
  750. # Assume object instance was passed in.
  751. rel_obj = kwargs.pop(field.name)
  752. is_related_object = True
  753. except KeyError:
  754. try:
  755. # Object instance wasn't passed in -- must be an ID.
  756. val = kwargs.pop(field.attname)
  757. except KeyError:
  758. val = field.get_default()
  759. else:
  760. # Object instance was passed in. Special case: You can
  761. # pass in "None" for related objects if it's allowed.
  762. if rel_obj is None and field.null:
  763. val = None
  764. else:
  765. try:
  766. val = kwargs.pop(field.attname)
  767. except KeyError:
  768. # This is done with an exception rather than the
  769. # default argument on pop because we don't want
  770. # get_default() to be evaluated, and then not used.
  771. # Refs #12057.
  772. val = field.get_default()
  773. else:
  774. val = field.get_default()
  775.  
  776. if is_related_object:
  777. # If we are passed a related instance, set it using the
  778. # field.name instead of field.attname (e.g. "user" instead of
  779. # "user_id") so that the object gets properly cached (and type
  780. # checked) by the RelatedObjectDescriptor.
  781. setattr(self, field.name, rel_obj)
  782. else:
  783. setattr(self, field.attname, val)
  784.  
  785. if kwargs:
  786. for prop in list(kwargs):
  787. try:
  788. if isinstance(getattr(self.__class__, prop), property):
  789. setattr(self, prop, kwargs.pop(prop))
  790. except AttributeError:
  791. pass
  792. if kwargs:
  793. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  794. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  795.  
  796. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  797. ___________________________________________________________________________________________________________________ XlsxwriterWriterTests.test_msrp_event_dec ____________________________________________________________________________________________________________________
  798.  
  799. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_msrp_event_dec>
  800.  
  801. def setUp(self):
  802. self.filename = None
  803. self.display_name = 'test'
  804.  
  805. self.user = User.objects.create_user(
  806. username='test',
  807. password='password123',
  808. email='test@example.com'
  809. )
  810.  
  811. > self.rows = self._create_test_data()
  812.  
  813. apps/retail/tests/test_excel.py:200:
  814. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  815. apps/retail/tests/test_excel.py:222: in _create_test_data
  816. **rsd_data
  817. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  818. return getattr(self.get_queryset(), name)(*args, **kwargs)
  819. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  820. obj = self.model(**kwargs)
  821. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  822.  
  823. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa4909c7358>, val = ''
  824. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  825.  
  826. def __init__(self, *args, **kwargs):
  827. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  828.  
  829. # Set up the storage for instance state
  830. self._state = ModelState()
  831.  
  832. # There is a rather weird disparity here; if kwargs, it's set, then args
  833. # overrides it. It should be one or the other; don't duplicate the work
  834. # The reason for the kwargs check is that standard iterator passes in by
  835. # args, and instantiation for iteration is 33% faster.
  836. args_len = len(args)
  837. if args_len > len(self._meta.concrete_fields):
  838. # Daft, but matches old exception sans the err msg.
  839. raise IndexError("Number of args exceeds number of fields")
  840.  
  841. if not kwargs:
  842. fields_iter = iter(self._meta.concrete_fields)
  843. # The ordering of the zip calls matter - zip throws StopIteration
  844. # when an iter throws it. So if the first iter throws it, the second
  845. # is *not* consumed. We rely on this, so don't change the order
  846. # without changing the logic.
  847. for val, field in zip(args, fields_iter):
  848. setattr(self, field.attname, val)
  849. else:
  850. # Slower, kwargs-ready version.
  851. fields_iter = iter(self._meta.fields)
  852. for val, field in zip(args, fields_iter):
  853. setattr(self, field.attname, val)
  854. kwargs.pop(field.name, None)
  855. # Maintain compatibility with existing calls.
  856. if isinstance(field.remote_field, ManyToOneRel):
  857. kwargs.pop(field.attname, None)
  858.  
  859. # Now we're left with the unprocessed fields that *must* come from
  860. # keywords, or default.
  861.  
  862. for field in fields_iter:
  863. is_related_object = False
  864. # This slightly odd construct is so that we can access any
  865. # data-descriptor object (DeferredAttribute) without triggering its
  866. # __get__ method.
  867. if (field.attname not in kwargs and
  868. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  869. or field.column is None)):
  870. # This field will be populated on request.
  871. continue
  872. if kwargs:
  873. if isinstance(field.remote_field, ForeignObjectRel):
  874. try:
  875. # Assume object instance was passed in.
  876. rel_obj = kwargs.pop(field.name)
  877. is_related_object = True
  878. except KeyError:
  879. try:
  880. # Object instance wasn't passed in -- must be an ID.
  881. val = kwargs.pop(field.attname)
  882. except KeyError:
  883. val = field.get_default()
  884. else:
  885. # Object instance was passed in. Special case: You can
  886. # pass in "None" for related objects if it's allowed.
  887. if rel_obj is None and field.null:
  888. val = None
  889. else:
  890. try:
  891. val = kwargs.pop(field.attname)
  892. except KeyError:
  893. # This is done with an exception rather than the
  894. # default argument on pop because we don't want
  895. # get_default() to be evaluated, and then not used.
  896. # Refs #12057.
  897. val = field.get_default()
  898. else:
  899. val = field.get_default()
  900.  
  901. if is_related_object:
  902. # If we are passed a related instance, set it using the
  903. # field.name instead of field.attname (e.g. "user" instead of
  904. # "user_id") so that the object gets properly cached (and type
  905. # checked) by the RelatedObjectDescriptor.
  906. setattr(self, field.name, rel_obj)
  907. else:
  908. setattr(self, field.attname, val)
  909.  
  910. if kwargs:
  911. for prop in list(kwargs):
  912. try:
  913. if isinstance(getattr(self.__class__, prop), property):
  914. setattr(self, prop, kwargs.pop(prop))
  915. except AttributeError:
  916. pass
  917. if kwargs:
  918. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  919. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  920.  
  921. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  922. ___________________________________________________________________________________________________________________ XlsxwriterWriterTests.test_msrp_event_inc ____________________________________________________________________________________________________________________
  923.  
  924. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_msrp_event_inc>
  925.  
  926. def setUp(self):
  927. self.filename = None
  928. self.display_name = 'test'
  929.  
  930. self.user = User.objects.create_user(
  931. username='test',
  932. password='password123',
  933. email='test@example.com'
  934. )
  935.  
  936. > self.rows = self._create_test_data()
  937.  
  938. apps/retail/tests/test_excel.py:200:
  939. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  940. apps/retail/tests/test_excel.py:222: in _create_test_data
  941. **rsd_data
  942. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  943. return getattr(self.get_queryset(), name)(*args, **kwargs)
  944. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  945. obj = self.model(**kwargs)
  946. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  947.  
  948. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa49204f6a0>, val = ''
  949. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  950.  
  951. def __init__(self, *args, **kwargs):
  952. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  953.  
  954. # Set up the storage for instance state
  955. self._state = ModelState()
  956.  
  957. # There is a rather weird disparity here; if kwargs, it's set, then args
  958. # overrides it. It should be one or the other; don't duplicate the work
  959. # The reason for the kwargs check is that standard iterator passes in by
  960. # args, and instantiation for iteration is 33% faster.
  961. args_len = len(args)
  962. if args_len > len(self._meta.concrete_fields):
  963. # Daft, but matches old exception sans the err msg.
  964. raise IndexError("Number of args exceeds number of fields")
  965.  
  966. if not kwargs:
  967. fields_iter = iter(self._meta.concrete_fields)
  968. # The ordering of the zip calls matter - zip throws StopIteration
  969. # when an iter throws it. So if the first iter throws it, the second
  970. # is *not* consumed. We rely on this, so don't change the order
  971. # without changing the logic.
  972. for val, field in zip(args, fields_iter):
  973. setattr(self, field.attname, val)
  974. else:
  975. # Slower, kwargs-ready version.
  976. fields_iter = iter(self._meta.fields)
  977. for val, field in zip(args, fields_iter):
  978. setattr(self, field.attname, val)
  979. kwargs.pop(field.name, None)
  980. # Maintain compatibility with existing calls.
  981. if isinstance(field.remote_field, ManyToOneRel):
  982. kwargs.pop(field.attname, None)
  983.  
  984. # Now we're left with the unprocessed fields that *must* come from
  985. # keywords, or default.
  986.  
  987. for field in fields_iter:
  988. is_related_object = False
  989. # This slightly odd construct is so that we can access any
  990. # data-descriptor object (DeferredAttribute) without triggering its
  991. # __get__ method.
  992. if (field.attname not in kwargs and
  993. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  994. or field.column is None)):
  995. # This field will be populated on request.
  996. continue
  997. if kwargs:
  998. if isinstance(field.remote_field, ForeignObjectRel):
  999. try:
  1000. # Assume object instance was passed in.
  1001. rel_obj = kwargs.pop(field.name)
  1002. is_related_object = True
  1003. except KeyError:
  1004. try:
  1005. # Object instance wasn't passed in -- must be an ID.
  1006. val = kwargs.pop(field.attname)
  1007. except KeyError:
  1008. val = field.get_default()
  1009. else:
  1010. # Object instance was passed in. Special case: You can
  1011. # pass in "None" for related objects if it's allowed.
  1012. if rel_obj is None and field.null:
  1013. val = None
  1014. else:
  1015. try:
  1016. val = kwargs.pop(field.attname)
  1017. except KeyError:
  1018. # This is done with an exception rather than the
  1019. # default argument on pop because we don't want
  1020. # get_default() to be evaluated, and then not used.
  1021. # Refs #12057.
  1022. val = field.get_default()
  1023. else:
  1024. val = field.get_default()
  1025.  
  1026. if is_related_object:
  1027. # If we are passed a related instance, set it using the
  1028. # field.name instead of field.attname (e.g. "user" instead of
  1029. # "user_id") so that the object gets properly cached (and type
  1030. # checked) by the RelatedObjectDescriptor.
  1031. setattr(self, field.name, rel_obj)
  1032. else:
  1033. setattr(self, field.attname, val)
  1034.  
  1035. if kwargs:
  1036. for prop in list(kwargs):
  1037. try:
  1038. if isinstance(getattr(self.__class__, prop), property):
  1039. setattr(self, prop, kwargs.pop(prop))
  1040. except AttributeError:
  1041. pass
  1042. if kwargs:
  1043. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  1044. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  1045.  
  1046. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  1047. ___________________________________________________________________________________________________________________ XlsxwriterWriterTests.test_msrp_event_none ___________________________________________________________________________________________________________________
  1048.  
  1049. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_msrp_event_none>
  1050.  
  1051. def setUp(self):
  1052. self.filename = None
  1053. self.display_name = 'test'
  1054.  
  1055. self.user = User.objects.create_user(
  1056. username='test',
  1057. password='password123',
  1058. email='test@example.com'
  1059. )
  1060.  
  1061. > self.rows = self._create_test_data()
  1062.  
  1063. apps/retail/tests/test_excel.py:200:
  1064. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1065. apps/retail/tests/test_excel.py:222: in _create_test_data
  1066. **rsd_data
  1067. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  1068. return getattr(self.get_queryset(), name)(*args, **kwargs)
  1069. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  1070. obj = self.model(**kwargs)
  1071. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1072.  
  1073. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa4928edf60>, val = ''
  1074. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  1075.  
  1076. def __init__(self, *args, **kwargs):
  1077. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  1078.  
  1079. # Set up the storage for instance state
  1080. self._state = ModelState()
  1081.  
  1082. # There is a rather weird disparity here; if kwargs, it's set, then args
  1083. # overrides it. It should be one or the other; don't duplicate the work
  1084. # The reason for the kwargs check is that standard iterator passes in by
  1085. # args, and instantiation for iteration is 33% faster.
  1086. args_len = len(args)
  1087. if args_len > len(self._meta.concrete_fields):
  1088. # Daft, but matches old exception sans the err msg.
  1089. raise IndexError("Number of args exceeds number of fields")
  1090.  
  1091. if not kwargs:
  1092. fields_iter = iter(self._meta.concrete_fields)
  1093. # The ordering of the zip calls matter - zip throws StopIteration
  1094. # when an iter throws it. So if the first iter throws it, the second
  1095. # is *not* consumed. We rely on this, so don't change the order
  1096. # without changing the logic.
  1097. for val, field in zip(args, fields_iter):
  1098. setattr(self, field.attname, val)
  1099. else:
  1100. # Slower, kwargs-ready version.
  1101. fields_iter = iter(self._meta.fields)
  1102. for val, field in zip(args, fields_iter):
  1103. setattr(self, field.attname, val)
  1104. kwargs.pop(field.name, None)
  1105. # Maintain compatibility with existing calls.
  1106. if isinstance(field.remote_field, ManyToOneRel):
  1107. kwargs.pop(field.attname, None)
  1108.  
  1109. # Now we're left with the unprocessed fields that *must* come from
  1110. # keywords, or default.
  1111.  
  1112. for field in fields_iter:
  1113. is_related_object = False
  1114. # This slightly odd construct is so that we can access any
  1115. # data-descriptor object (DeferredAttribute) without triggering its
  1116. # __get__ method.
  1117. if (field.attname not in kwargs and
  1118. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  1119. or field.column is None)):
  1120. # This field will be populated on request.
  1121. continue
  1122. if kwargs:
  1123. if isinstance(field.remote_field, ForeignObjectRel):
  1124. try:
  1125. # Assume object instance was passed in.
  1126. rel_obj = kwargs.pop(field.name)
  1127. is_related_object = True
  1128. except KeyError:
  1129. try:
  1130. # Object instance wasn't passed in -- must be an ID.
  1131. val = kwargs.pop(field.attname)
  1132. except KeyError:
  1133. val = field.get_default()
  1134. else:
  1135. # Object instance was passed in. Special case: You can
  1136. # pass in "None" for related objects if it's allowed.
  1137. if rel_obj is None and field.null:
  1138. val = None
  1139. else:
  1140. try:
  1141. val = kwargs.pop(field.attname)
  1142. except KeyError:
  1143. # This is done with an exception rather than the
  1144. # default argument on pop because we don't want
  1145. # get_default() to be evaluated, and then not used.
  1146. # Refs #12057.
  1147. val = field.get_default()
  1148. else:
  1149. val = field.get_default()
  1150.  
  1151. if is_related_object:
  1152. # If we are passed a related instance, set it using the
  1153. # field.name instead of field.attname (e.g. "user" instead of
  1154. # "user_id") so that the object gets properly cached (and type
  1155. # checked) by the RelatedObjectDescriptor.
  1156. setattr(self, field.name, rel_obj)
  1157. else:
  1158. setattr(self, field.attname, val)
  1159.  
  1160. if kwargs:
  1161. for prop in list(kwargs):
  1162. try:
  1163. if isinstance(getattr(self.__class__, prop), property):
  1164. setattr(self, prop, kwargs.pop(prop))
  1165. except AttributeError:
  1166. pass
  1167. if kwargs:
  1168. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  1169. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  1170.  
  1171. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  1172. ___________________________________________________________________________________________________________________ XlsxwriterWriterTests.test_msrp_event_zero ___________________________________________________________________________________________________________________
  1173.  
  1174. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_msrp_event_zero>
  1175.  
  1176. def setUp(self):
  1177. self.filename = None
  1178. self.display_name = 'test'
  1179.  
  1180. self.user = User.objects.create_user(
  1181. username='test',
  1182. password='password123',
  1183. email='test@example.com'
  1184. )
  1185.  
  1186. > self.rows = self._create_test_data()
  1187.  
  1188. apps/retail/tests/test_excel.py:200:
  1189. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1190. apps/retail/tests/test_excel.py:222: in _create_test_data
  1191. **rsd_data
  1192. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  1193. return getattr(self.get_queryset(), name)(*args, **kwargs)
  1194. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  1195. obj = self.model(**kwargs)
  1196. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1197.  
  1198. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa49239bb38>, val = ''
  1199. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  1200.  
  1201. def __init__(self, *args, **kwargs):
  1202. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  1203.  
  1204. # Set up the storage for instance state
  1205. self._state = ModelState()
  1206.  
  1207. # There is a rather weird disparity here; if kwargs, it's set, then args
  1208. # overrides it. It should be one or the other; don't duplicate the work
  1209. # The reason for the kwargs check is that standard iterator passes in by
  1210. # args, and instantiation for iteration is 33% faster.
  1211. args_len = len(args)
  1212. if args_len > len(self._meta.concrete_fields):
  1213. # Daft, but matches old exception sans the err msg.
  1214. raise IndexError("Number of args exceeds number of fields")
  1215.  
  1216. if not kwargs:
  1217. fields_iter = iter(self._meta.concrete_fields)
  1218. # The ordering of the zip calls matter - zip throws StopIteration
  1219. # when an iter throws it. So if the first iter throws it, the second
  1220. # is *not* consumed. We rely on this, so don't change the order
  1221. # without changing the logic.
  1222. for val, field in zip(args, fields_iter):
  1223. setattr(self, field.attname, val)
  1224. else:
  1225. # Slower, kwargs-ready version.
  1226. fields_iter = iter(self._meta.fields)
  1227. for val, field in zip(args, fields_iter):
  1228. setattr(self, field.attname, val)
  1229. kwargs.pop(field.name, None)
  1230. # Maintain compatibility with existing calls.
  1231. if isinstance(field.remote_field, ManyToOneRel):
  1232. kwargs.pop(field.attname, None)
  1233.  
  1234. # Now we're left with the unprocessed fields that *must* come from
  1235. # keywords, or default.
  1236.  
  1237. for field in fields_iter:
  1238. is_related_object = False
  1239. # This slightly odd construct is so that we can access any
  1240. # data-descriptor object (DeferredAttribute) without triggering its
  1241. # __get__ method.
  1242. if (field.attname not in kwargs and
  1243. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  1244. or field.column is None)):
  1245. # This field will be populated on request.
  1246. continue
  1247. if kwargs:
  1248. if isinstance(field.remote_field, ForeignObjectRel):
  1249. try:
  1250. # Assume object instance was passed in.
  1251. rel_obj = kwargs.pop(field.name)
  1252. is_related_object = True
  1253. except KeyError:
  1254. try:
  1255. # Object instance wasn't passed in -- must be an ID.
  1256. val = kwargs.pop(field.attname)
  1257. except KeyError:
  1258. val = field.get_default()
  1259. else:
  1260. # Object instance was passed in. Special case: You can
  1261. # pass in "None" for related objects if it's allowed.
  1262. if rel_obj is None and field.null:
  1263. val = None
  1264. else:
  1265. try:
  1266. val = kwargs.pop(field.attname)
  1267. except KeyError:
  1268. # This is done with an exception rather than the
  1269. # default argument on pop because we don't want
  1270. # get_default() to be evaluated, and then not used.
  1271. # Refs #12057.
  1272. val = field.get_default()
  1273. else:
  1274. val = field.get_default()
  1275.  
  1276. if is_related_object:
  1277. # If we are passed a related instance, set it using the
  1278. # field.name instead of field.attname (e.g. "user" instead of
  1279. # "user_id") so that the object gets properly cached (and type
  1280. # checked) by the RelatedObjectDescriptor.
  1281. setattr(self, field.name, rel_obj)
  1282. else:
  1283. setattr(self, field.attname, val)
  1284.  
  1285. if kwargs:
  1286. for prop in list(kwargs):
  1287. try:
  1288. if isinstance(getattr(self.__class__, prop), property):
  1289. setattr(self, prop, kwargs.pop(prop))
  1290. except AttributeError:
  1291. pass
  1292. if kwargs:
  1293. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  1294. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  1295.  
  1296. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  1297. ___________________________________________________________________________________________________________________ XlsxwriterWriterTests.test_percent_format ____________________________________________________________________________________________________________________
  1298.  
  1299. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_percent_format>
  1300.  
  1301. def setUp(self):
  1302. self.filename = None
  1303. self.display_name = 'test'
  1304.  
  1305. self.user = User.objects.create_user(
  1306. username='test',
  1307. password='password123',
  1308. email='test@example.com'
  1309. )
  1310.  
  1311. > self.rows = self._create_test_data()
  1312.  
  1313. apps/retail/tests/test_excel.py:200:
  1314. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1315. apps/retail/tests/test_excel.py:222: in _create_test_data
  1316. **rsd_data
  1317. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  1318. return getattr(self.get_queryset(), name)(*args, **kwargs)
  1319. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  1320. obj = self.model(**kwargs)
  1321. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1322.  
  1323. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa4928d30b8>, val = ''
  1324. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  1325.  
  1326. def __init__(self, *args, **kwargs):
  1327. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  1328.  
  1329. # Set up the storage for instance state
  1330. self._state = ModelState()
  1331.  
  1332. # There is a rather weird disparity here; if kwargs, it's set, then args
  1333. # overrides it. It should be one or the other; don't duplicate the work
  1334. # The reason for the kwargs check is that standard iterator passes in by
  1335. # args, and instantiation for iteration is 33% faster.
  1336. args_len = len(args)
  1337. if args_len > len(self._meta.concrete_fields):
  1338. # Daft, but matches old exception sans the err msg.
  1339. raise IndexError("Number of args exceeds number of fields")
  1340.  
  1341. if not kwargs:
  1342. fields_iter = iter(self._meta.concrete_fields)
  1343. # The ordering of the zip calls matter - zip throws StopIteration
  1344. # when an iter throws it. So if the first iter throws it, the second
  1345. # is *not* consumed. We rely on this, so don't change the order
  1346. # without changing the logic.
  1347. for val, field in zip(args, fields_iter):
  1348. setattr(self, field.attname, val)
  1349. else:
  1350. # Slower, kwargs-ready version.
  1351. fields_iter = iter(self._meta.fields)
  1352. for val, field in zip(args, fields_iter):
  1353. setattr(self, field.attname, val)
  1354. kwargs.pop(field.name, None)
  1355. # Maintain compatibility with existing calls.
  1356. if isinstance(field.remote_field, ManyToOneRel):
  1357. kwargs.pop(field.attname, None)
  1358.  
  1359. # Now we're left with the unprocessed fields that *must* come from
  1360. # keywords, or default.
  1361.  
  1362. for field in fields_iter:
  1363. is_related_object = False
  1364. # This slightly odd construct is so that we can access any
  1365. # data-descriptor object (DeferredAttribute) without triggering its
  1366. # __get__ method.
  1367. if (field.attname not in kwargs and
  1368. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  1369. or field.column is None)):
  1370. # This field will be populated on request.
  1371. continue
  1372. if kwargs:
  1373. if isinstance(field.remote_field, ForeignObjectRel):
  1374. try:
  1375. # Assume object instance was passed in.
  1376. rel_obj = kwargs.pop(field.name)
  1377. is_related_object = True
  1378. except KeyError:
  1379. try:
  1380. # Object instance wasn't passed in -- must be an ID.
  1381. val = kwargs.pop(field.attname)
  1382. except KeyError:
  1383. val = field.get_default()
  1384. else:
  1385. # Object instance was passed in. Special case: You can
  1386. # pass in "None" for related objects if it's allowed.
  1387. if rel_obj is None and field.null:
  1388. val = None
  1389. else:
  1390. try:
  1391. val = kwargs.pop(field.attname)
  1392. except KeyError:
  1393. # This is done with an exception rather than the
  1394. # default argument on pop because we don't want
  1395. # get_default() to be evaluated, and then not used.
  1396. # Refs #12057.
  1397. val = field.get_default()
  1398. else:
  1399. val = field.get_default()
  1400.  
  1401. if is_related_object:
  1402. # If we are passed a related instance, set it using the
  1403. # field.name instead of field.attname (e.g. "user" instead of
  1404. # "user_id") so that the object gets properly cached (and type
  1405. # checked) by the RelatedObjectDescriptor.
  1406. setattr(self, field.name, rel_obj)
  1407. else:
  1408. setattr(self, field.attname, val)
  1409.  
  1410. if kwargs:
  1411. for prop in list(kwargs):
  1412. try:
  1413. if isinstance(getattr(self.__class__, prop), property):
  1414. setattr(self, prop, kwargs.pop(prop))
  1415. except AttributeError:
  1416. pass
  1417. if kwargs:
  1418. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  1419. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  1420.  
  1421. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  1422. _____________________________________________________________________________________________________________ XlsxwriterWriterTests.test_properites_written_to_file ______________________________________________________________________________________________________________
  1423.  
  1424. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_properites_written_to_file>
  1425.  
  1426. def setUp(self):
  1427. self.filename = None
  1428. self.display_name = 'test'
  1429.  
  1430. self.user = User.objects.create_user(
  1431. username='test',
  1432. password='password123',
  1433. email='test@example.com'
  1434. )
  1435.  
  1436. > self.rows = self._create_test_data()
  1437.  
  1438. apps/retail/tests/test_excel.py:200:
  1439. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1440. apps/retail/tests/test_excel.py:222: in _create_test_data
  1441. **rsd_data
  1442. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  1443. return getattr(self.get_queryset(), name)(*args, **kwargs)
  1444. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  1445. obj = self.model(**kwargs)
  1446. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1447.  
  1448. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa4928dcf98>, val = ''
  1449. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  1450.  
  1451. def __init__(self, *args, **kwargs):
  1452. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  1453.  
  1454. # Set up the storage for instance state
  1455. self._state = ModelState()
  1456.  
  1457. # There is a rather weird disparity here; if kwargs, it's set, then args
  1458. # overrides it. It should be one or the other; don't duplicate the work
  1459. # The reason for the kwargs check is that standard iterator passes in by
  1460. # args, and instantiation for iteration is 33% faster.
  1461. args_len = len(args)
  1462. if args_len > len(self._meta.concrete_fields):
  1463. # Daft, but matches old exception sans the err msg.
  1464. raise IndexError("Number of args exceeds number of fields")
  1465.  
  1466. if not kwargs:
  1467. fields_iter = iter(self._meta.concrete_fields)
  1468. # The ordering of the zip calls matter - zip throws StopIteration
  1469. # when an iter throws it. So if the first iter throws it, the second
  1470. # is *not* consumed. We rely on this, so don't change the order
  1471. # without changing the logic.
  1472. for val, field in zip(args, fields_iter):
  1473. setattr(self, field.attname, val)
  1474. else:
  1475. # Slower, kwargs-ready version.
  1476. fields_iter = iter(self._meta.fields)
  1477. for val, field in zip(args, fields_iter):
  1478. setattr(self, field.attname, val)
  1479. kwargs.pop(field.name, None)
  1480. # Maintain compatibility with existing calls.
  1481. if isinstance(field.remote_field, ManyToOneRel):
  1482. kwargs.pop(field.attname, None)
  1483.  
  1484. # Now we're left with the unprocessed fields that *must* come from
  1485. # keywords, or default.
  1486.  
  1487. for field in fields_iter:
  1488. is_related_object = False
  1489. # This slightly odd construct is so that we can access any
  1490. # data-descriptor object (DeferredAttribute) without triggering its
  1491. # __get__ method.
  1492. if (field.attname not in kwargs and
  1493. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  1494. or field.column is None)):
  1495. # This field will be populated on request.
  1496. continue
  1497. if kwargs:
  1498. if isinstance(field.remote_field, ForeignObjectRel):
  1499. try:
  1500. # Assume object instance was passed in.
  1501. rel_obj = kwargs.pop(field.name)
  1502. is_related_object = True
  1503. except KeyError:
  1504. try:
  1505. # Object instance wasn't passed in -- must be an ID.
  1506. val = kwargs.pop(field.attname)
  1507. except KeyError:
  1508. val = field.get_default()
  1509. else:
  1510. # Object instance was passed in. Special case: You can
  1511. # pass in "None" for related objects if it's allowed.
  1512. if rel_obj is None and field.null:
  1513. val = None
  1514. else:
  1515. try:
  1516. val = kwargs.pop(field.attname)
  1517. except KeyError:
  1518. # This is done with an exception rather than the
  1519. # default argument on pop because we don't want
  1520. # get_default() to be evaluated, and then not used.
  1521. # Refs #12057.
  1522. val = field.get_default()
  1523. else:
  1524. val = field.get_default()
  1525.  
  1526. if is_related_object:
  1527. # If we are passed a related instance, set it using the
  1528. # field.name instead of field.attname (e.g. "user" instead of
  1529. # "user_id") so that the object gets properly cached (and type
  1530. # checked) by the RelatedObjectDescriptor.
  1531. setattr(self, field.name, rel_obj)
  1532. else:
  1533. setattr(self, field.attname, val)
  1534.  
  1535. if kwargs:
  1536. for prop in list(kwargs):
  1537. try:
  1538. if isinstance(getattr(self.__class__, prop), property):
  1539. setattr(self, prop, kwargs.pop(prop))
  1540. except AttributeError:
  1541. pass
  1542. if kwargs:
  1543. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  1544. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  1545.  
  1546. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  1547. ____________________________________________________________________________________________________________________ XlsxwriterWriterTests.test_writer_header ____________________________________________________________________________________________________________________
  1548.  
  1549. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_writer_header>
  1550.  
  1551. def setUp(self):
  1552. self.filename = None
  1553. self.display_name = 'test'
  1554.  
  1555. self.user = User.objects.create_user(
  1556. username='test',
  1557. password='password123',
  1558. email='test@example.com'
  1559. )
  1560.  
  1561. > self.rows = self._create_test_data()
  1562.  
  1563. apps/retail/tests/test_excel.py:200:
  1564. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1565. apps/retail/tests/test_excel.py:222: in _create_test_data
  1566. **rsd_data
  1567. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  1568. return getattr(self.get_queryset(), name)(*args, **kwargs)
  1569. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  1570. obj = self.model(**kwargs)
  1571. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1572.  
  1573. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa49372bf98>, val = ''
  1574. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  1575.  
  1576. def __init__(self, *args, **kwargs):
  1577. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  1578.  
  1579. # Set up the storage for instance state
  1580. self._state = ModelState()
  1581.  
  1582. # There is a rather weird disparity here; if kwargs, it's set, then args
  1583. # overrides it. It should be one or the other; don't duplicate the work
  1584. # The reason for the kwargs check is that standard iterator passes in by
  1585. # args, and instantiation for iteration is 33% faster.
  1586. args_len = len(args)
  1587. if args_len > len(self._meta.concrete_fields):
  1588. # Daft, but matches old exception sans the err msg.
  1589. raise IndexError("Number of args exceeds number of fields")
  1590.  
  1591. if not kwargs:
  1592. fields_iter = iter(self._meta.concrete_fields)
  1593. # The ordering of the zip calls matter - zip throws StopIteration
  1594. # when an iter throws it. So if the first iter throws it, the second
  1595. # is *not* consumed. We rely on this, so don't change the order
  1596. # without changing the logic.
  1597. for val, field in zip(args, fields_iter):
  1598. setattr(self, field.attname, val)
  1599. else:
  1600. # Slower, kwargs-ready version.
  1601. fields_iter = iter(self._meta.fields)
  1602. for val, field in zip(args, fields_iter):
  1603. setattr(self, field.attname, val)
  1604. kwargs.pop(field.name, None)
  1605. # Maintain compatibility with existing calls.
  1606. if isinstance(field.remote_field, ManyToOneRel):
  1607. kwargs.pop(field.attname, None)
  1608.  
  1609. # Now we're left with the unprocessed fields that *must* come from
  1610. # keywords, or default.
  1611.  
  1612. for field in fields_iter:
  1613. is_related_object = False
  1614. # This slightly odd construct is so that we can access any
  1615. # data-descriptor object (DeferredAttribute) without triggering its
  1616. # __get__ method.
  1617. if (field.attname not in kwargs and
  1618. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  1619. or field.column is None)):
  1620. # This field will be populated on request.
  1621. continue
  1622. if kwargs:
  1623. if isinstance(field.remote_field, ForeignObjectRel):
  1624. try:
  1625. # Assume object instance was passed in.
  1626. rel_obj = kwargs.pop(field.name)
  1627. is_related_object = True
  1628. except KeyError:
  1629. try:
  1630. # Object instance wasn't passed in -- must be an ID.
  1631. val = kwargs.pop(field.attname)
  1632. except KeyError:
  1633. val = field.get_default()
  1634. else:
  1635. # Object instance was passed in. Special case: You can
  1636. # pass in "None" for related objects if it's allowed.
  1637. if rel_obj is None and field.null:
  1638. val = None
  1639. else:
  1640. try:
  1641. val = kwargs.pop(field.attname)
  1642. except KeyError:
  1643. # This is done with an exception rather than the
  1644. # default argument on pop because we don't want
  1645. # get_default() to be evaluated, and then not used.
  1646. # Refs #12057.
  1647. val = field.get_default()
  1648. else:
  1649. val = field.get_default()
  1650.  
  1651. if is_related_object:
  1652. # If we are passed a related instance, set it using the
  1653. # field.name instead of field.attname (e.g. "user" instead of
  1654. # "user_id") so that the object gets properly cached (and type
  1655. # checked) by the RelatedObjectDescriptor.
  1656. setattr(self, field.name, rel_obj)
  1657. else:
  1658. setattr(self, field.attname, val)
  1659.  
  1660. if kwargs:
  1661. for prop in list(kwargs):
  1662. try:
  1663. if isinstance(getattr(self.__class__, prop), property):
  1664. setattr(self, prop, kwargs.pop(prop))
  1665. except AttributeError:
  1666. pass
  1667. if kwargs:
  1668. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  1669. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  1670.  
  1671. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  1672. _____________________________________________________________________________________________________________________ XlsxwriterWriterTests.test_writer_rows _____________________________________________________________________________________________________________________
  1673.  
  1674. self = <apps.retail.tests.test_excel.XlsxwriterWriterTests testMethod=test_writer_rows>
  1675.  
  1676. def setUp(self):
  1677. self.filename = None
  1678. self.display_name = 'test'
  1679.  
  1680. self.user = User.objects.create_user(
  1681. username='test',
  1682. password='password123',
  1683. email='test@example.com'
  1684. )
  1685.  
  1686. > self.rows = self._create_test_data()
  1687.  
  1688. apps/retail/tests/test_excel.py:200:
  1689. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1690. apps/retail/tests/test_excel.py:222: in _create_test_data
  1691. **rsd_data
  1692. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/manager.py:122: in manager_method
  1693. return getattr(self.get_queryset(), name)(*args, **kwargs)
  1694. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/query.py:399: in create
  1695. obj = self.model(**kwargs)
  1696. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  1697.  
  1698. self = <RetailSourceData: Uncalculated RetailSourceData Object>, args = (), kwargs = {'retail_price_changeset': <RetailPriceChangeset: test (Nov. 6, 2016 8:46 p.m.)>}, args_len = 0, fields_iter = <tuple_iterator object at 0x7fa492a11e48>, val = ''
  1699. field = <django.db.models.fields.CharField: group>, is_related_object = False, prop = 'retail_price_changeset'
  1700.  
  1701. def __init__(self, *args, **kwargs):
  1702. signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
  1703.  
  1704. # Set up the storage for instance state
  1705. self._state = ModelState()
  1706.  
  1707. # There is a rather weird disparity here; if kwargs, it's set, then args
  1708. # overrides it. It should be one or the other; don't duplicate the work
  1709. # The reason for the kwargs check is that standard iterator passes in by
  1710. # args, and instantiation for iteration is 33% faster.
  1711. args_len = len(args)
  1712. if args_len > len(self._meta.concrete_fields):
  1713. # Daft, but matches old exception sans the err msg.
  1714. raise IndexError("Number of args exceeds number of fields")
  1715.  
  1716. if not kwargs:
  1717. fields_iter = iter(self._meta.concrete_fields)
  1718. # The ordering of the zip calls matter - zip throws StopIteration
  1719. # when an iter throws it. So if the first iter throws it, the second
  1720. # is *not* consumed. We rely on this, so don't change the order
  1721. # without changing the logic.
  1722. for val, field in zip(args, fields_iter):
  1723. setattr(self, field.attname, val)
  1724. else:
  1725. # Slower, kwargs-ready version.
  1726. fields_iter = iter(self._meta.fields)
  1727. for val, field in zip(args, fields_iter):
  1728. setattr(self, field.attname, val)
  1729. kwargs.pop(field.name, None)
  1730. # Maintain compatibility with existing calls.
  1731. if isinstance(field.remote_field, ManyToOneRel):
  1732. kwargs.pop(field.attname, None)
  1733.  
  1734. # Now we're left with the unprocessed fields that *must* come from
  1735. # keywords, or default.
  1736.  
  1737. for field in fields_iter:
  1738. is_related_object = False
  1739. # This slightly odd construct is so that we can access any
  1740. # data-descriptor object (DeferredAttribute) without triggering its
  1741. # __get__ method.
  1742. if (field.attname not in kwargs and
  1743. (isinstance(self.__class__.__dict__.get(field.attname), DeferredAttribute)
  1744. or field.column is None)):
  1745. # This field will be populated on request.
  1746. continue
  1747. if kwargs:
  1748. if isinstance(field.remote_field, ForeignObjectRel):
  1749. try:
  1750. # Assume object instance was passed in.
  1751. rel_obj = kwargs.pop(field.name)
  1752. is_related_object = True
  1753. except KeyError:
  1754. try:
  1755. # Object instance wasn't passed in -- must be an ID.
  1756. val = kwargs.pop(field.attname)
  1757. except KeyError:
  1758. val = field.get_default()
  1759. else:
  1760. # Object instance was passed in. Special case: You can
  1761. # pass in "None" for related objects if it's allowed.
  1762. if rel_obj is None and field.null:
  1763. val = None
  1764. else:
  1765. try:
  1766. val = kwargs.pop(field.attname)
  1767. except KeyError:
  1768. # This is done with an exception rather than the
  1769. # default argument on pop because we don't want
  1770. # get_default() to be evaluated, and then not used.
  1771. # Refs #12057.
  1772. val = field.get_default()
  1773. else:
  1774. val = field.get_default()
  1775.  
  1776. if is_related_object:
  1777. # If we are passed a related instance, set it using the
  1778. # field.name instead of field.attname (e.g. "user" instead of
  1779. # "user_id") so that the object gets properly cached (and type
  1780. # checked) by the RelatedObjectDescriptor.
  1781. setattr(self, field.name, rel_obj)
  1782. else:
  1783. setattr(self, field.attname, val)
  1784.  
  1785. if kwargs:
  1786. for prop in list(kwargs):
  1787. try:
  1788. if isinstance(getattr(self.__class__, prop), property):
  1789. setattr(self, prop, kwargs.pop(prop))
  1790. except AttributeError:
  1791. pass
  1792. if kwargs:
  1793. > raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
  1794. E TypeError: 'retail_price_changeset' is an invalid keyword argument for this function
  1795.  
  1796. /opt/www/ikura/lib/python3.5/site-packages/django/db/models/base.py:451: TypeError
  1797. ================================================================================================================ 14 failed, 16 passed, 3 skipped in 23.53 seconds ================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement