Imagine a test case that magically find all of the PageFactory subclasses within a project, and for each class found, test that:
- It can successfully create an instance of that page type
- The created page doesn't error when viewed normally
- The created page doesn't error when viewed in 'preview' mode
I think this could easily be achieved by keeping a 'reference' dict that gets populated via a metaclass when subclasses are defined (a bit like what Wagtail does with wagtail.core.models.PAGE_MODEL_CLASSES)
We could ignore any factories that do not specify a model value in their Meta class. And maybe even introduce a new/optional Meta option that could be used to explicitly opt-out of testing for a specific factory class.