Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

341
Views
TypeError: '_SentinelObject' object is not callable

I am upgrading my Django application from version 2.2 to 3.2. while upgrading i am facing below issue, i have spent a lot of time to resolve this but didn't get any solution yet.

here's the traceback of issue which i am facing:

  File ".../abc/test.py", line 85, in setUp
    self.MODEL_A.save()
  File ".../abc/models.py", line 470, in save
    super(MODEL_A, self).save(*args, **kwargs)
  File ".../lib/python3.8/site-packages/django/db/models/base.py", line 726, in save
    self.save_base(using=using, force_insert=force_insert,
  File ".../lib/python3.8/site-packages/django/db/models/base.py", line 763, in save_base
    updated = self._save_table(
  File ".../lib/python3.8/site-packages/django/db/models/base.py", line 842, in _save_table
    values = [(f, None, (getattr(self, f.attname) if raw else f.pre_save(self, False)))
  File ".../lib/python3.8/site-packages/django/db/models/base.py", line 842, in <listcomp>
    values = [(f, None, (getattr(self, f.attname) if raw else f.pre_save(self, False)))
  File ".../lib/python3.8/site-packages/django/db/models/fields/__init__.py", line 1396, in pre_save
    value = timezone.now()
TypeError: '_SentinelObject' object is not callable

Any help would be highly appreciated.

Thanks in advance.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Assigning objects which don't support copy.deepcopy() during setUpTestData() is deprecated. Either assign the unit attribute during setUpClass() or setUp(), or add support for deepcopy().

So there might be a code in your test cases like below:

@classmethod
def setUpTestData(cls):
    super(YourTestClassNameHere, cls).setUpTestData()

Change this code as follows:

@classmethod
def setUpClass(cls):
    super(YourTestClassNameHere, cls).setUpClass()

This will resolve your _SentinelObject issues.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!