Did I find the right examples for you? yes no

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)
Deprecated: Use multisite.SiteID(default=1) for identical behaviour.

        def SiteIDHook():
    """Deprecated: Use multisite.SiteID(default=1) for identical behaviour."""
    warn('Use multisite.SiteID instead of multisite.threadlocals.SiteIDHook',
         DeprecationWarning, stacklevel=2)
    return SiteID(default=1)
        


src/d/j/django-multisite-0.3.1/multisite/tests.py   django-multisite(Download)
from .middleware import CookieDomainMiddleware, DynamicSiteMiddleware
from .models import Alias
from .threadlocals import SiteIDHook
 
 
    def test_deprecation_warning(self):
        with warnings.catch_warnings(record=True) as w:
            warnings.simplefilter('always')
            threadlocals.__warningregistry__ = {}
            SiteIDHook()
    def test_default_value(self):
        with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            site_id = SiteIDHook()
            self.assertEqual(site_id.default, 1)