def login(self, username='testclient', password='password'):
            if username == 'staff':
                username = 'staffmember@example.com'
            elif '@' not in username:
                username = username + '@example.com'
            return super(EmailLoginMixin, self).login(username, password)
Authtools uses email addresses to login.
dataset/ETHPy150Open fusionbox/django-authtools/tests/tests/tests.py/EmailLoginMixin.login