def test_logged_in_only_experiments_return_control_even_if_forced_when_logged_out( self): request = FakeRequest(AnonymousUser()) force_into_branch(request, "logged_in_only", "experimental") self.assertTrue(request.experiments.is_in("logged_in_only", "control"))
def test_staff_can_be_forced_into_experiment(self): request = FakeRequest(create_user(staff=True)) force_into_branch(request, "forced_into_experimental", "control") self.assertTrue( request.experiments.is_in("forced_into_experimental", "control"))
def test_forced_into_experiment(self): request = FakeRequest() force_into_branch(request, "forced_into_control", "experimental") self.assertTrue( request.experiments.is_in("forced_into_control", "experimental"))
def test_staff_can_be_forced_into_experiment(self): request = FakeRequest(create_user(staff=True)) force_into_branch(request, "forced_into_experimental", "control") self.assertTrue(request.experiments.is_in("forced_into_experimental", "control"))
def test_forced_into_experiment(self): request = FakeRequest() force_into_branch(request, "forced_into_control", "experimental") self.assertTrue(request.experiments.is_in("forced_into_control", "experimental"))
def test_logged_in_only_experiments_return_control_even_if_forced_when_logged_out(self): request = FakeRequest(AnonymousUser()) force_into_branch(request, "logged_in_only", "experimental") self.assertTrue(request.experiments.is_in("logged_in_only", "control"))