Add unit tests for wagtailcore/whitelist.py