I have decorator @login_testuser
applied to method test_1()
:
class TestCase(object):
@login_testuser
def test_1(self):
print "test_1()"
Is there a way I can apply @login_testuser
on every method of the class prefixed with "test_"
?
In other words, the decorator would apply to test_1()
, test_2()
methods below, but not on setUp()
.
class TestCase(object):
def setUp(self):
pass
def test_1(self):
print "test_1()"
def test_2(self):
print "test_2()"