Changes between Initial Version and Version 1 of Ticket #29810


Ignore:
Timestamp:
Oct 1, 2018, 4:56:39 AM (6 years ago)
Author:
Dmitrii Azarenko
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29810 – Description

    initial v1  
    1313}}}
    1414}}}
     15{{{#!div style="font-size: 80%"
     16Error:
     17{{{
     18............E.s................
     19======================================================================
     20ERROR: test_select_related_empty_join (filtered_relation.tests.FilteredRelationTests)
     21----------------------------------------------------------------------
     22Traceback (most recent call last):
     23  File "/usr/lib/python3.6/unittest/case.py", line 59, in testPartExecutor
     24    yield
     25  File "/usr/lib/python3.6/unittest/case.py", line 605, in run
     26    testMethod()
     27  File "/home/adv/projects/github/django/tests/filtered_relation/tests.py", line 46, in test_select_related_empty_join
     28    ).select_related('empty_join')
     29  File "/usr/lib/python3.6/unittest/case.py", line 674, in assertFalse
     30    if expr:
     31  File "/home/adv/projects/github/django/django/db/models/query.py", line 271, in __bool__
     32    self._fetch_all()
     33  File "/home/adv/projects/github/django/django/db/models/query.py", line 1232, in _fetch_all
     34    self._result_cache = list(self._iterable_class(self))
     35  File "/home/adv/projects/github/django/django/db/models/query.py", line 67, in __iter__
     36    rel_populator.populate(row, obj)
     37  File "/home/adv/projects/github/django/django/db/models/query.py", line 1876, in populate
     38    self.local_setter(from_obj, obj)
     39  File "/home/adv/projects/github/django/django/db/models/sql/compiler.py", line 892, in local_setter
     40    f.remote_field.set_cached_value(from_obj, obj)
     41  File "/home/adv/projects/github/django/django/db/models/fields/mixins.py", line 23, in set_cached_value
     42    instance._state.fields_cache[self.get_cache_name()] = value
     43AttributeError: 'NoneType' object has no attribute '_state'
     44
     45----------------------------------------------------------------------
     46}}}
     47}}}
    1548
    1649This bug is typical since version 2.0 and exists until now.
Back to Top