The test_func doesn't appear to run at all. Right now I'm just checking if the user is staff, as an easy test. Here's the code:
class MyModelCreate(CreateView, UserPassesTestMixin):
def test_func(self):
print("checking if user passes test....")
return self.request.user.is_staff
model = MyModel
....
However, when I go to the create page for this model, anyone can edit it, and there is no output to the python console showing that the test_func runs.
The view is called:
urlpatterns = [
...
url(r'^create/$', views.MyModelCreate.as_view(), name='my_model_create'),
]