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

All Samples(18)  |  Call(14)  |  Derive(0)  |  Import(4)

src/d/j/django-tenant-schemas-1.4.6-1-ga6e682d/tenant_schemas/tests/tenants.py   django-tenant-schemas(Download)
from django.conf import settings
from django.db import connection
from django.test.testcases import TransactionTestCase
from tenant_schemas.tests.models import Tenant, NonAutoSyncTenant, DummyModel
from tenant_schemas.utils import (tenant_context, schema_exists,
        # add the public tenant
        self.public_tenant_domain = 'test.com'
        self.public_tenant = Tenant(domain_url=self.public_tenant_domain,
                                    schema_name='public')
        self.public_tenant.save()
    def test_tenant_schema_is_created(self):
        """
        when saving a tenant, it's schema should be created
        """
        tenant = Tenant(domain_url='something.test.com', schema_name='test')
    def test_sync_tenant(self):
        """
        when editing an existing tenant, all data should be kept
        """
        tenant = Tenant(domain_url='something.test.com', schema_name='test')
    def test_switching_search_path(self):
        dummies_tenant1_count, dummies_tenant2_count = 0, 0
 
        tenant1 = Tenant(domain_url='something.test.com',
                         schema_name='tenant1')

src/d/j/django-tenant-schemas-HEAD/tenant_schemas/tests/tenants.py   django-tenant-schemas(Download)
from django.conf import settings
from django.db import connection
from django.test.testcases import TransactionTestCase
from tenant_schemas.tests.models import Tenant, NonAutoSyncTenant, DummyModel
from tenant_schemas.utils import (tenant_context, schema_exists,
        # add the public tenant
        self.public_tenant_domain = 'test.com'
        self.public_tenant = Tenant(domain_url=self.public_tenant_domain,
                                    schema_name='public')
        self.public_tenant.save()
    def test_tenant_schema_is_created(self):
        """
        when saving a tenant, it's schema should be created
        """
        tenant = Tenant(domain_url='something.test.com', schema_name='test')
    def test_sync_tenant(self):
        """
        when editing an existing tenant, all data should be kept
        """
        tenant = Tenant(domain_url='something.test.com', schema_name='test')
    def test_switching_search_path(self):
        dummies_tenant1_count, dummies_tenant2_count = 0, 0
 
        tenant1 = Tenant(domain_url='something.test.com',
                         schema_name='tenant1')

src/d/j/django-tenant-schemas-1.4.6-1-ga6e682d/tenant_schemas/tests/routes.py   django-tenant-schemas(Download)
from django.test.client import RequestFactory
from tenant_schemas.middleware import TenantMiddleware
from tenant_schemas.tests.models import Tenant
from tenant_schemas.utils import get_public_schema_name
 
        # add the public tenant
        self.public_tenant_domain = 'test.com'
        self.public_tenant = Tenant(domain_url=self.public_tenant_domain,
                                    schema_name='public')
        self.public_tenant.save()
 
        # add a test tenant
        self.tenant_domain = 'tenant.test.com'
        self.tenant = Tenant(domain_url=self.tenant_domain, schema_name='test')

src/d/j/django-tenant-schemas-HEAD/tenant_schemas/tests/routes.py   django-tenant-schemas(Download)
from django.test.client import RequestFactory
from tenant_schemas.middleware import TenantMiddleware
from tenant_schemas.tests.models import Tenant
from tenant_schemas.utils import get_public_schema_name
 
        # add the public tenant
        self.public_tenant_domain = 'test.com'
        self.public_tenant = Tenant(domain_url=self.public_tenant_domain,
                                    schema_name='public')
        self.public_tenant.save()
 
        # add a test tenant
        self.tenant_domain = 'tenant.test.com'
        self.tenant = Tenant(domain_url=self.tenant_domain, schema_name='test')