Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests failed with Django 1.8 #53

Closed
felixonmars opened this issue Apr 9, 2015 · 1 comment
Closed

Tests failed with Django 1.8 #53

felixonmars opened this issue Apr 9, 2015 · 1 comment

Comments

@felixonmars
Copy link

I am getting the following errors when running PyAMF tests against Django 1.8. Maybe django.db.models.fields.related.ForeignObjectRel should be used instead of
django.db.models.related.RelatedObject?

======================================================================
ERROR: test_dynamic (pyamf.adapters.tests.test_django.ClassAliasTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 274, in test_dynamic
    alias = adapter.DjangoClassAlias(models.SimplestModel, 'Book')
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_non_field_prop (pyamf.adapters.tests.test_django.ClassAliasTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 255, in test_non_field_prop
    alias = adapter.DjangoClassAlias(Book, 'Book')
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_properties (pyamf.adapters.tests.test_django.ClassAliasTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 305, in test_properties
    alias = adapter.DjangoClassAlias(Foob, 'Bar')
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_time (pyamf.adapters.tests.test_django.ClassAliasTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 185, in test_time
    alias = adapter.DjangoClassAlias(models.TimeClass, None)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_undefined (pyamf.adapters.tests.test_django.ClassAliasTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 230, in test_undefined
    alias = adapter.DjangoClassAlias(UndefinedClass, None)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_encodable_attrs (pyamf.adapters.tests.test_django.DBColumnTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 805, in setUp
    self.alias = adapter.DjangoClassAlias(models.DBColumnModel, None)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_file (pyamf.adapters.tests.test_django.FieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 662, in test_file
    alias = adapter.DjangoClassAlias(models.FileModel)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_many_to_many (pyamf.adapters.tests.test_django.ForeignKeyTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 431, in test_many_to_many
    pub_alias = adapter.DjangoClassAlias(models.Publication, None)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_nullable_foreign_keys (pyamf.adapters.tests.test_django.ForeignKeyTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 476, in test_nullable_foreign_keys
    nfk_alias = adapter.DjangoClassAlias(models.NullForeignKey, None)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_one_to_many (pyamf.adapters.tests.test_django.ForeignKeyTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 359, in test_one_to_many
    attrs = alias.getEncodableAttributes(a)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 170, in getEncodableAttributes
    attrs = pyamf.ClassAlias.getEncodableAttributes(self, obj, **kwargs)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 398, in getEncodableAttributes
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_static_relation (pyamf.adapters.tests.test_django.ForeignKeyTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 498, in test_static_relation
    static_attrs=('gak',)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_image (pyamf.adapters.tests.test_django.ImageTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 695, in test_image
    alias = adapter.DjangoClassAlias(models.Profile)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_abstract (pyamf.adapters.tests.test_django.ModelInheritanceTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 597, in test_abstract
    alias = adapter.DjangoClassAlias(models.Student)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 141, in compile
    self._compile_base_class(c)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 106, in _compile_base_class
    pyamf.ClassAlias._compile_base_class(self, klass)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 156, in _compile_base_class
    alias.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_concrete (pyamf.adapters.tests.test_django.ModelInheritanceTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 611, in test_concrete
    alias = adapter.DjangoClassAlias(models.Place)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_behaviour (pyamf.adapters.tests.test_django.PKTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 547, in test_behaviour
    article_alias = adapter.DjangoClassAlias(models.Article, None)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_no_pk (pyamf.adapters.tests.test_django.PKTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 583, in test_no_pk
    encoded = pyamf.encode(instances, encoding=pyamf.AMF3).getvalue()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/__init__.py", line 459, in encode
    [encoder.writeElement(el) for el in args]
  File "cpyamf/codec.pyx", line 614, in cpyamf.codec.Encoder.writeElement (cpyamf/codec.c:10548)
    cpdef int writeElement(self, object element) except -1:
  File "cpyamf/codec.pyx", line 620, in cpyamf.codec.Encoder.writeElement (cpyamf/codec.c:10307)
    ret = self.handleBasicTypes(element, py_type)
  File "cpyamf/amf3.pyx", line 1030, in cpyamf.amf3.Encoder.handleBasicTypes (cpyamf/amf3.c:12425)
    cdef int ret = codec.Encoder.handleBasicTypes(self, element, py_type)
  File "cpyamf/codec.pyx", line 572, in cpyamf.codec.Encoder.handleBasicTypes (cpyamf/codec.c:9539)
    ret = self.writeList(element)
  File "cpyamf/amf3.pyx", line 722, in cpyamf.amf3.Encoder.writeList (cpyamf/amf3.c:9426)
    self.writeElement(<object>x)
  File "cpyamf/codec.pyx", line 640, in cpyamf.codec.Encoder.writeElement (cpyamf/codec.c:10472)
    func(element)
  File "cpyamf/codec.pyx", line 691, in cpyamf.codec._CustomTypeFunc.__call__ (cpyamf/codec.c:11186)
    ret = self.func(data, encoder=self.encoder)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 288, in writeDjangoObject
    encoder.writeObject(obj)
  File "cpyamf/amf3.pyx", line 850, in cpyamf.amf3.Encoder.writeObject (cpyamf/amf3.c:11692)
    cpdef int writeObject(self, object obj, bint is_proxy=0) except -1:
  File "cpyamf/amf3.pyx", line 885, in cpyamf.amf3.Encoder.writeObject (cpyamf/amf3.c:11093)
    definition = ClassDefinition(alias)
  File "cpyamf/amf3.pyx", line 80, in cpyamf.amf3.ClassDefinition.__init__ (cpyamf/amf3.c:1913)
    alias.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_none (pyamf.adapters.tests.test_django.PKTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 565, in test_none
    alias = adapter.DjangoClassAlias(models.SimplestModel, None)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 67, in __init__
    self.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

======================================================================
ERROR: test_referenced_encode (pyamf.adapters.tests.test_django.ReferenceTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/tests/test_django.py", line 777, in test_referenced_encode
    '\tname\x06\x00\x01\x04\x04%s\x06\x06\x02\x01' % chr(ref_id),
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/tests/util.py", line 69, in assertEncoded
    assert_buffer(self, self.encode(arg), args)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/tests/util.py", line 61, in encode
    self.encoder.writeElement(arg)
  File "cpyamf/codec.pyx", line 614, in cpyamf.codec.Encoder.writeElement (cpyamf/codec.c:10548)
    cpdef int writeElement(self, object element) except -1:
  File "cpyamf/codec.pyx", line 640, in cpyamf.codec.Encoder.writeElement (cpyamf/codec.c:10472)
    func(element)
  File "cpyamf/codec.pyx", line 691, in cpyamf.codec._CustomTypeFunc.__call__ (cpyamf/codec.c:11186)
    ret = self.func(data, encoder=self.encoder)
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 301, in writeDjangoObject
    encoder.writeObject(referenced_object)
  File "cpyamf/amf3.pyx", line 850, in cpyamf.amf3.Encoder.writeObject (cpyamf/amf3.c:11692)
    cpdef int writeObject(self, object obj, bint is_proxy=0) except -1:
  File "cpyamf/amf3.pyx", line 885, in cpyamf.amf3.Encoder.writeObject (cpyamf/amf3.c:11093)
    definition = ClassDefinition(alias)
  File "cpyamf/amf3.pyx", line 80, in cpyamf.amf3.ClassDefinition.__init__ (cpyamf/amf3.c:1913)
    alias.compile()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/alias.py", line 143, in compile
    self.getCustomProperties()
  File "/build/python-pyamf/src/PyAMF-0.7.2-py2/pyamf/adapters/_django_db_models_base.py", line 77, in getCustomProperties
    if isinstance(x, related.RelatedObject):
AttributeError: 'module' object has no attribute 'RelatedObject'

----------------------------------------------------------------------
Ran 795 tests in 0.888s

FAILED (errors=18, skipped=79)
@njoyce
Copy link
Member

njoyce commented Dec 8, 2015

This should be fixed in adbc979

@njoyce njoyce closed this as completed Dec 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants