Fixed #23768 -- Rewrote template tests as unit tests

django.template sorts before django.test