Skip to content

Django 3.2 setUpTestData uses copy.deepcopy() #246

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

Closed
vchrisb opened this issue Jun 20, 2021 · 3 comments · Fixed by #265
Closed

Django 3.2 setUpTestData uses copy.deepcopy() #246

vchrisb opened this issue Jun 20, 2021 · 3 comments · Fixed by #265
Assignees
Labels

Comments

@vchrisb
Copy link

vchrisb commented Jun 20, 2021

Using setUpTestData() with django-stdimage in Django 3.2 does not work anymore, as it look like copy.deepcopy() is not supported with django-stdimage.

Changed in Django 3.2:
Objects assigned to class attributes in setUpTestData() must support creating deep copies with copy.deepcopy() in order to > isolate them from alterations performed by each test methods. In previous versions of Django these objects were reused > and changes made to them were persisted between test methods.

@codingjoe codingjoe added the bug label Jun 21, 2021
@codingjoe
Copy link
Owner

Hi @vchrisb,

Thanks for reaching out and good find. Would you be interested in providing a patch? I be delighted to review it.

Best,
Joe

@vchrisb
Copy link
Author

vchrisb commented Jun 21, 2021

I'll see what I can do. 👍

@awais786
Copy link

awais786 commented Sep 20, 2021

I am facing similar issue with django32 tests cases. Is there any plan for patch ?

https://docs.djangoproject.com/en/3.2/releases/3.2/#tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants