def attach_file(self, path, mimetype=None):
        filename = os.path.basename(path)
        content = open(path, 'rb').read()
        self.attach(filename, content, mimetype)
Test that the user_passes_test decorator can be applied multiple times
dataset/ETHPy150Open CollabQ/CollabQ/vendor/django/core/mail.py/EmailMessage.attach_file--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.3/tests/regressiontests/decorators/tests.py/DecoratorsTest.test_user_passes_test_composition