1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #25791 -- Implement autoreload behaviour for cached template loader.

This commit is contained in:
Tom Forbes
2020-11-05 12:18:20 +01:00
committed by Carlton Gibson
parent 29845ecf69
commit 658bcc16f1
7 changed files with 191 additions and 7 deletions

View File

@@ -14,6 +14,8 @@ from pathlib import Path
from subprocess import CompletedProcess
from unittest import mock, skip, skipIf
import pytz
import django.__main__
from django.apps.registry import Apps
from django.test import SimpleTestCase
@@ -201,6 +203,26 @@ class TestChildArguments(SimpleTestCase):
autoreload.get_child_arguments()
class TestUtilities(SimpleTestCase):
def test_is_django_module(self):
for module, expected in (
(pytz, False),
(sys, False),
(autoreload, True)
):
with self.subTest(module=module):
self.assertIs(autoreload.is_django_module(module), expected)
def test_is_django_path(self):
for module, expected in (
(pytz.__file__, False),
(contextlib.__file__, False),
(autoreload.__file__, True)
):
with self.subTest(module=module):
self.assertIs(autoreload.is_django_path(module), expected)
class TestCommonRoots(SimpleTestCase):
def test_common_roots(self):
paths = (