Imported custom user classes in tests depending on it

Without those imports, affected test files cannot be run
independently. Refs #21164.
Fixed #9722 - used pyinotify as change detection system when available

Used pyinotify (when available) to replace the "pool-every-one-second"
mechanism in `django.utils.autoreload`.