コード例 #1
0
ファイル: test_models.py プロジェクト: johngian/mozillians
 def test_search_no_public_with_unvouched(self, PrivacyAwareSMock):
     result = UserProfileMappingType.search("foo", include_non_vouched=True)
     ok_(isinstance(result, Mock))
     PrivacyAwareSMock.assert_any_call(UserProfileMappingType)
     PrivacyAwareSMock().indexes.assert_any_call("index")
     ok_(call().indexes().boost().query().order_by().filter(is_vouched=True) not in PrivacyAwareSMock.mock_calls)
     ok_(call().privacy_level(PUBLIC) not in PrivacyAwareSMock.mock_calls)
コード例 #2
0
ファイル: test_models.py プロジェクト: royshouvik/mozillians
 def test_search_no_public_only_vouched(self, PrivacyAwareSMock):
     result = UserProfileMappingType.search('foo')
     ok_(isinstance(result, Mock))
     PrivacyAwareSMock.assert_any_call(UserProfileMappingType)
     PrivacyAwareSMock().indexes.assert_any_call('index')
     (PrivacyAwareSMock().indexes().boost()
      .query().order_by().filter.assert_any_call(is_vouched=True))
     ok_(call().privacy_level(PUBLIC) not in PrivacyAwareSMock.mock_calls)
コード例 #3
0
 def test_search_no_public_with_unvouched(self, PrivacyAwareSMock):
     result = UserProfileMappingType.search('foo', include_non_vouched=True)
     ok_(isinstance(result, Mock))
     PrivacyAwareSMock.assert_any_call(UserProfileMappingType)
     PrivacyAwareSMock().indexes.assert_any_call('index')
     ok_(call().indexes().boost().query().order_by().filter(
         is_vouched=True) not in PrivacyAwareSMock.mock_calls)
     ok_(call().privacy_level(PUBLIC) not in PrivacyAwareSMock.mock_calls)
コード例 #4
0
 def test_search_public_only_vouched(self, PrivacyAwareSMock):
     result = UserProfileMappingType.search('foo', public=True)
     ok_(isinstance(result, Mock))
     PrivacyAwareSMock.assert_any_call(UserProfileMappingType)
     PrivacyAwareSMock().privacy_level.assert_any_call(PUBLIC)
     (PrivacyAwareSMock().privacy_level().indexes.assert_any_call(
         'public_index'))
     (PrivacyAwareSMock().privacy_level().indexes().boost().query().
      order_by().filter.assert_any_call(is_vouched=True))
コード例 #5
0
ファイル: test_models.py プロジェクト: johngian/mozillians
 def test_search_public_only_vouched(self, PrivacyAwareSMock):
     result = UserProfileMappingType.search("foo", public=True)
     ok_(isinstance(result, Mock))
     PrivacyAwareSMock.assert_any_call(UserProfileMappingType)
     PrivacyAwareSMock().privacy_level.assert_any_call(PUBLIC)
     (PrivacyAwareSMock().privacy_level().indexes.assert_any_call("public_index"))
     (
         PrivacyAwareSMock()
         .privacy_level()
         .indexes()
         .boost()
         .query()
         .order_by()
         .filter.assert_any_call(is_vouched=True)
     )