"""Run from the supplied project's lessons folder; data is temporary.""" from pathlib import Path import sys lesson_folder = Path(__file__).resolve().parent # A lesson filename must not shadow an installed package such as whitenoise. sys.path = [entry for entry in sys.path if Path(entry or ".").resolve() != lesson_folder] sys.path.insert(0, str(lesson_folder.parent)) from lab_support import start start() from workshops.models import Venue, Workshop, Reservation from django.test import Client, RequestFactory, override_settings # Lesson code: the shared lab is ready, with three fictional workshops. from django.contrib.staticfiles import finders from django.templatetags.static import static path = finders.find("workshops/site.css") print(path is not None) print(static("workshops/site.css")) print("background" in open(path, encoding="utf-8").read())