970
970
"""Make an arbitrary bug target with no tasks on it."""
971
971
return IBugTarget(self.factory.makeProduct())
973
def test_bug_privacy_filter_private_only_param_with_no_user(self):
974
# The bug privacy filter expression always has the "private is false"
975
# clause if the specified user is None, regardless of the value of the
976
# private_only parameter.
977
filter = get_bug_privacy_filter(None)
978
self.assertIn('Bug.private IS FALSE', filter)
979
filter = get_bug_privacy_filter(None, private_only=True)
980
self.assertIn('Bug.private IS FALSE', filter)
982
def test_bug_privacy_filter_private_only_param_with_user(self):
983
# The bug privacy filter expression omits has the "private is false"
984
# clause if the private_only parameter is True, provided a user is
986
any_user = self.factory.makePerson()
987
filter = get_bug_privacy_filter(any_user)
988
self.assertIn('Bug.private IS FALSE', filter)
989
filter = get_bug_privacy_filter(any_user, private_only=True)
990
self.assertNotIn('Bug.private IS FALSE', filter)
973
992
def test_no_tasks(self):
974
993
# A brand new bug target has no tasks.
975
994
target = self.makeBugTarget()