class UserSettingsView(LoginRequiredMixin, UserPassesTestMixin, View):

    def test_func(self):
        return test_settings(self.request.user)

def get_login_url(self):
    if not self.request.user.is_authenticated():
        return super(UserSettingsView, self).get_login_url()
How to use the user_passes_test decorator in class based views?