#24007: Unable to unpickle models from an external script
------------------------------+------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: new
Component: Core (Other) | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by timgraham):
* status: closed => new
* has_patch: 1 => 0
* resolution: fixed =>
* stage: Ready for checkin => Accepted
Comment:
Another problem with the test when running it outside the tests directory:
{{{
$ ./tests/runtests.py model_regress
Testing against Django installed in '/home/tim/code/django/django'
Creating test database for alias 'default'...
Creating test database for alias 'other'...
.............s..Traceback (most recent call last):
File "/home/tim/code/django/tmpCkJ7D2.py", line 9, in <module>
article = pickle.loads(data)
File "/usr/lib/python2.7/pickle.py", line 1382, in loads
return Unpickler(file).load()
File "/usr/lib/python2.7/pickle.py", line 858, in load
dispatch[key](self)
File "/usr/lib/python2.7/pickle.py", line 1133, in load_reduce
value = func(*args)
File "/home/tim/code/django/django/db/models/base.py", line 1662, in
model_unpickle
apps.populate(settings.INSTALLED_APPS)
File "/home/tim/code/django/django/apps/registry.py", line 85, in
populate
app_config = AppConfig.create(entry)
File "/home/tim/code/django/django/apps/config.py", line 87, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
import_module
__import__(name)
ImportError: No module named model_regress
F.
======================================================================
FAIL: test_unpickling_when_appregistrynotready
(model_regress.test_pickle.ModelPickleTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tim/code/django/tests/model_regress/test_pickle.py", line
88, in test_unpickling_when_appregistrynotready
self.fail("Unable to reload model pickled data")
AssertionError: Unable to reload model pickled data
----------------------------------------------------------------------
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24007#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.b39c5acdabc29ea129e27fa2effc2519%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.