def test_create_raise_exception_if_no_tenant_set_or_passed(self): clear_current_tenant() user = mommy.make('auth.User') with self.assertRaises(TenantNotFoundError): self.articles_manager.create(title="Test Article", text="Test Article Description", author=user)
def test_get_all_tenant_permissions_without_tenant(self): clear_current_tenant() auth_backend = TenantModelBackend() self.assertEqual( len(auth_backend.get_all_tenant_permissions(self.user)), 0 )
def test__get_permissions_without_tenant(self): clear_current_tenant() auth_backend = TenantModelBackend() self.assertEqual( len(auth_backend._get_permissions(self.user, None, 'group')), 0 )
def test_return_nothing_if_no_tenant_set_or_passed(self): clear_current_tenant() self.assertEqual(self.articles_manager.all().count(), 0)
def test_create_raise_exception_if_no_tenant_set_or_passed(self): clear_current_tenant() with self.assertRaises(TenantNotFoundError): self.tags_manager.create(text="Test tag")