python类clear()的实例源码

apply.py 文件源码 项目:django-open-volunteering-platform 作者: OpenVolunteeringPlatform 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def setUp(self):
    cache.clear()
project.py 文件源码 项目:django-open-volunteering-platform 作者: OpenVolunteeringPlatform 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def setUp(self):
    ChannelSetting.objects.create(key="CAN_CREATE_PROJECTS_WITHOUT_ORGANIZATION", value="1", object_channel="default")
    cache.clear()
project.py 文件源码 项目:django-open-volunteering-platform 作者: OpenVolunteeringPlatform 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def test_can_create_in_any_organization_if_settings_allow(self):
    """Test user can create project inside any organization if properly configured"""
    ChannelSetting.objects.create(key="CAN_CREATE_PROJECTS_IN_ANY_ORGANIZATION", value="1", object_channel="default")
    cache.clear()

    wrong_org = Organization(name="test", type=0, owner=self.second_user)
    wrong_org.save(object_channel="default")

    self.data['organization_id'] = wrong_org.pk
    response = self.client.post(reverse("project-list"), self.data, format="json")
    self.assertTrue(response.status_code == 201)
test_views.py 文件源码 项目:django-open-volunteering-platform 作者: OpenVolunteeringPlatform 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def setUp(self):
    call_command('clear_index', '--noinput', verbosity=0)
    Channel.objects.create(name="Test channel", slug="test-channel")
    create_sample_projects()
    self.client = APIClient()

    cache.clear()
test_views.py 文件源码 项目:django-open-volunteering-platform 作者: OpenVolunteeringPlatform 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def setUp(self):
    call_command('clear_index', '--noinput', verbosity=0)
    Channel.objects.create(name="Test channel", slug="test-channel")
    create_sample_organizations()
    self.client = APIClient()

    cache.clear()
test_views.py 文件源码 项目:django-open-volunteering-platform 作者: OpenVolunteeringPlatform 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def setUp(self):
    call_command('clear_index', '--noinput', verbosity=0)
    Channel.objects.create(name="Test channel", slug="test-channel")
    create_sample_users()
    self.client = APIClient()

    ChannelSetting.objects.create(key="ENABLE_USER_SEARCH", value="1", object_channel="default")
    ChannelSetting.objects.create(key="ENABLE_USER_SEARCH", value="1", object_channel="test-channel")
    cache.clear()
test_views.py 文件源码 项目:django-open-volunteering-platform 作者: OpenVolunteeringPlatform 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def test_user_search_must_be_enabled(self):
    """
    Test searching for users must be enabled in settings
    """
    ChannelSetting.objects.all().delete()
    cache.clear()

    response = self.client.get(reverse("search-users-list"), format="json")
    self.assertEqual(response.status_code, 403)


问题


面经


文章

微信
公众号

扫码关注公众号