/usr/lib/python3/dist-packages/pytest_django/django_compat.py is in python3-pytest-django 2.9.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Note that all functions here assume django is available. So ensure
# this is the case before you call them.
def is_django_unittest(request_or_item):
"""Returns True if the request_or_item is a Django test case, otherwise False"""
try:
from django.test import SimpleTestCase as TestCase
except ImportError:
from django.test import TestCase
cls = getattr(request_or_item, 'cls', None)
if cls is None:
return False
return issubclass(cls, TestCase)
|