graphql-python / graphql-python/graphene-django
AttributeError: 'function' object has no attribute 'wrapped' in Django 2.2
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 760
- PR merge metrics
- No merged PRs in 30d
Description
In Django 2.2 (works fine in 2.1) tests, connections are overridden/monkey patched with properties that throw errors, specifically the `connection.cursor` method.
https://github.com/django/django/blob/master/django/test/testcases.py#L210
Graphene also monkey patches `connection.cursor`.
https://github.com/graphql-python/graphene-django/blob/master/graphene_django/debug/sql/tracking.py#L43
This causes tests to fail when Django attempts to undo the monkey patch.
https://github.com/django/django/blob/master/django/test/testcases.py#L220
The following error occurs:
```
ERROR: tearDownClass (point_of_sale.tests.graphene.queries.e2e_test_cash_and_check_batch_query.CashAndCheckBatchQueryTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/cedar/api/common/testing/test_cases/db_test_case.py", line 44, in tearDownClass
super(TestCase, cls).tearDownClass()
File "/usr/local/lib/python3.6/dist-packages/django/test/testcases.py", line 244, in tearDownClass
cls._remove_databases_failures()
File "/usr/local/lib/python3.6/dist-packages/django/test/testcases.py", line 240, in _remove_databases_failures
setattr(connection, name, method.wrapped)
AttributeError: 'function' object has no attribute 'wrapped'
----------------------------------------------------------------------
```
This test is using the Django test client to test the /graphql endpoint.
https://docs.djangoproject.com/en/3.0/topics/testing/tools/#overview-and-a-quick-example
Contributor guide
Assessment
This issue has not been assessed yet.