Allow @requires_user_profile to decorate classes as well

Review Request #9950 — Created May 16, 2018 and submitted — Latest diff uploaded

Information

Djblets
release-1.0.x
784b405...

Reviewers

Djblets provided @requires_user_profile to ensure that the User
model has a get_profile method so that unit tests can run across
Django 1.6 (where User.get_profile exists) and Django 1.7+ (where it
has been removed).

This decorator has been updated to also work for classes. When applied
to a class, it will apply the decorator to all methods in the class that
begin with test_. In other words, it has the same effect as manually
applying the decorator to each test method in the class.

Ran unit tests on Django 1.6.11 and Django 1.8.19.