coderfly / fixtures-mongoengine

Fixtures for MongoEngine
https://pypi.python.org/pypi/fixtures_mongoengine
MIT License
6 stars 3 forks source link

AttributeError: 'odict_values' object has no attribute 'reverse' #6

Closed danie1k closed 4 years ago

danie1k commented 6 years ago

Python version: 3.5.2

Error appears in two lines:

  1. https://github.com/coderfly/fixtures-mongoengine/blob/master/fixtures_mongoengine/mixin.py#L161
  2. https://github.com/coderfly/fixtures-mongoengine/blob/master/fixtures_mongoengine/mixin.py#L171
    ...

    fixtures = self.get_fixtures().values()
    fixtures.reverse()

    ...

Reason:

But, at least in Python 3.5.2 it's not possible to call reverse() on odict_values.

Easiest workaround:

fixtures = list(self.get_fixtures().values())

I haven't investigated it deeper.

nikitagruia-dev commented 4 years ago

@danie1k the same problem, thank you for solution, made pull request

coderfly commented 4 years ago

Thanks for fix