Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(4)  |  Derive(0)  |  Import(1)

src/p/o/portfoliyo-HEAD/portfoliyo/users/auth_backend.py   portfoliyo(Download)
 
"""
from portfoliyo.model.users.auth_backend import EmailBackend
 

src/p/o/portfoliyo-HEAD/portfoliyo/tests/model/users/test_auth_backend.py   portfoliyo(Download)
def test_authenticate_failure(db):
    """authenticate method returns None if no matching user."""
    backend = auth_backend.EmailBackend()
    user = backend.authenticate(username='foo', password='bar')
 
def test_authenticate_select_related(db):
    """authenticate method returns user with profile pre-selected."""
    factories.ProfileFactory.create(
        user__email='test@example.com', user__password='testpw')
    backend = auth_backend.EmailBackend()
def test_get_user_select_related(db):
    """get_user method returns user with profile pre-selected."""
    profile = factories.ProfileFactory.create()
    backend = auth_backend.EmailBackend()
    user = backend.get_user(profile.user.id)
def test_get_user_nonexistent(db):
    """get_user method returns None if no matching user."""
    backend = auth_backend.EmailBackend()
    user = backend.get_user(999)