mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #13227 -- Adjusted a test to avoid making a shared test model unpickable.
This allowed the Note model to be used in setUpTestData() which requires assigned model instances to be copy.deepcopy()'able.
This commit is contained in:
committed by
Mariusz Felisiak
parent
0e3b0da2e3
commit
1dd96f731d
@@ -1,8 +1,6 @@
|
||||
"""
|
||||
Various complex queries that have been problematic in the past.
|
||||
"""
|
||||
import threading
|
||||
|
||||
from django.db import models
|
||||
from django.db.models.functions import Now
|
||||
|
||||
@@ -51,13 +49,6 @@ class Note(models.Model):
|
||||
def __str__(self):
|
||||
return self.note
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
# Regression for #13227 -- having an attribute that
|
||||
# is unpicklable doesn't stop you from cloning queries
|
||||
# that use objects of that type as an argument.
|
||||
self.lock = threading.Lock()
|
||||
|
||||
|
||||
class Annotation(models.Model):
|
||||
name = models.CharField(max_length=10)
|
||||
|
||||
Reference in New Issue
Block a user