Opened 16 years ago

Closed 16 years ago

#10796 closed (fixed)

test failure in regressiontests/queries/models.py

Reported by: Carl Meyer Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

On r10524 I'm getting this test failure (on SQLite):

======================================================================
FAIL: Doctest: regressiontests.queries.models.__test__.API_TESTS
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/carljm/projects/testproj_env/src/django/django/test/_doctest.py", line 2180, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for regressiontests.queries.models.__test__.API_TESTS
  File "/home/carljm/projects/testproj_env/src/django/tests/regressiontests/queries/models.py", line unknown line number, in API_TESTS

----------------------------------------------------------------------
File "/home/carljm/projects/testproj_env/src/django/tests/regressiontests/queries/models.py", line ?, in regressiontests.queries.models.__test__.API_TESTS
Failed example:
    _ = pickle.loads(pickle.dumps(qs))
Exception raised:
    Traceback (most recent call last):
      File "/home/carljm/projects/testproj_env/src/django/django/test/_doctest.py", line 1267, in __run
        compileflags, 1) in test.globs
      File "<doctest regressiontests.queries.models.__test__.API_TESTS[250]>", line 1, in <module>
        _ = pickle.loads(pickle.dumps(qs))
      File "/usr/lib/python2.5/pickle.py", line 1366, in dumps
        Pickler(file, protocol).dump(obj)
      File "/usr/lib/python2.5/pickle.py", line 224, in dump
        self.save(obj)
      File "/usr/lib/python2.5/pickle.py", line 331, in save
        self.save_reduce(obj=obj, *rv)
      File "/usr/lib/python2.5/pickle.py", line 419, in save_reduce
        save(state)
      File "/usr/lib/python2.5/pickle.py", line 286, in save
        f(self, obj) # Call unbound method with explicit self
      File "/usr/lib/python2.5/pickle.py", line 649, in save_dict
        self._batch_setitems(obj.iteritems())
      File "/usr/lib/python2.5/pickle.py", line 663, in _batch_setitems
        save(v)
      File "/usr/lib/python2.5/pickle.py", line 306, in save
        rv = reduce(self.proto)
      File "/usr/lib/python2.5/copy_reg.py", line 83, in _reduce_ex
        dict = getstate()
      File "/home/carljm/projects/testproj_env/src/django/django/db/models/sql/subqueries.py", line 370, in __getstate__
        return super(DateQuery, self).__getstate__()
      File "/home/carljm/projects/testproj_env/src/django/django/db/models/sql/query.py", line 128, in __getstate__
        obj_dict['select_fields'] = [f.name for f in obj_dict['select_fields']]
    AttributeError: 'NoneType' object has no attribute 'name'

Change History (1)

comment:1 by Russell Keith-Magee, 16 years ago

Resolution: fixed
Status: newclosed

(In [10526]) Fixed #10796 -- Corrected a pickling problem introduced by [10522]. Thanks to carljm for the report.

Note: See TracTickets for help on using tickets.
Back to Top