[TIP] Please help for StorageMediaNotFound

Madhusudan C.S madhusudancs at gmail.com
Wed Nov 18 10:34:47 PST 2009


Hi Kumar,
   First of all thanks a lot for the response.

On Wed, Nov 18, 2009 at 11:42 PM, Kumar McMillan
<kumar.mcmillan at gmail.com>wrote:

> On Wed, Nov 18, 2009 at 10:51 AM, Madhusudan C.S <madhusudancs at gmail.com>
> wrote:
> > Hello everyone,
> >    I am using fixture module for testing purposes on Appengine. When I
> run
> > the tests, I get this error
>
> Hi Madhusudan.  By default when loading a class named UserData,
> fixture will look for an appengine db model class named User.  The
> error indicates that fixture is not finding that User class in the
> module you have sent to GoogleDatastoreFixture(env=your_module)
>

The data models for our app doesn't reside in a single Python module, but
spread across several Python modules in the package called models.

Can you please tell me what should I do in this case? How should my

datafixture = GoogleDatastoreFixture(env=models, style=NamedDataStyle())  #
Note models is a package containing models in each file, for example user
model is in the module user.py.
self.data = datafixture.data(datasets.UserData)

be rewritten. Please help me.


>
> >
> > Traceback (most recent call last):
> >   File
> >
> "/media/python/workspace/melange-ghop-integration/tests/app/soc/modules/ghop/views/models/test_task.py",
> > line 130, in setUp
> >     self.data.setup()
> >   File
> >
> "/media/python/workspace/melange-ghop-integration/eggs/fixture-1.3.1-py2.5.egg/fixture/base.py",
> > line 71, in setup
> >     self.loader.load(self.data)
> >   File
> >
> "/media/python/workspace/melange-ghop-integration/eggs/fixture-1.3.1-py2.5.egg/fixture/loadable/loadable.py",
> > line 193, in load
> >     self.wrap_in_transaction(loader, unloading=False)
> >   File
> >
> "/media/python/workspace/melange-ghop-integration/eggs/fixture-1.3.1-py2.5.egg/fixture/loadable/loadable.py",
> > line 310, in wrap_in_transaction
> >     routine()
> >   File
> >
> "/media/python/workspace/melange-ghop-integration/eggs/fixture-1.3.1-py2.5.egg/fixture/loadable/loadable.py",
> > line 192, in loader
> >     self.load_dataset(ds)
> >   File
> >
> "/media/python/workspace/melange-ghop-integration/eggs/fixture-1.3.1-py2.5.egg/fixture/loadable/loadable.py",
> > line 217, in load_dataset
> >     self.attach_storage_medium(ds)
> >   File
> >
> "/media/python/workspace/melange-ghop-integration/eggs/fixture-1.3.1-py2.5.egg/fixture/loadable/loadable.py",
> > line 375, in attach_storage_medium
> >     self.Medium, ds.meta.storable_name, ds, repr_env))
> > StorageMediaNotFound: could not find <class
> > 'fixture.loadable.google_datastore_loadable.EntityMedium'> 'User' for
> > dataset <UserData at 0xa84decc with keys ['user_0001']> in self.env
> (<type
> > 'module'>)
> >
> > Can some one please tell me why I get this error and what I should to do
> to
> > fix this?
> >
> >
> > --
> > Thanks and regards,
> >  Madhusudan.C.S
> >
> > Blogs at: www.madhusudancs.info
> > My Online Identity: madhusudancs
> >
> > _______________________________________________
> > testing-in-python mailing list
> > testing-in-python at lists.idyll.org
> > http://lists.idyll.org/listinfo/testing-in-python
> >
> >
>



-- 
Thanks and regards,
 Madhusudan.C.S

Blogs at: www.madhusudancs.info
My Online Identity: madhusudancs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20091119/32f7baf2/attachment.htm>


More information about the testing-in-python mailing list