﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33333	Models with a BinaryField fail to deepcopy in setUpTestData() on PostgreSQL.	Adam Zimmerman	Mariusz Felisiak	"While using Postgres, models with a BinaryField fail to deepcopy, due to Django returning these field values as `memoryview` objects. This causes issues when creating instances in `setUpTestData()` during tests.

The specific errors seem to be fairly inconsistent and hard to reproduce. But often the exception complains about a missing `_state` field, or that `_state` has no attribute `db`.

I've currently worked around this by implementing a mixin for models where the `__getstate__()` method converts any `memoryview`s to `bytes`. But I don't know if that's the correct solution for Django generally."	Bug	closed	Database layer (models, ORM)	3.2	Release blocker	fixed		Simon Charette	Accepted	1	0	0	0	0	0
