def test_find_relevant_similar_no_ip(self): """ find_relevant_similar without an IP should return all the channels that share a subscription with the given channel. It should not include 0.0.0.0 as a common ip, ignored subscriptions, or non-approved channels. """ c0, c1, c2 = self.channels[:3] c4, c6, c8 = self.channels[4], self.channels[6], self.channels[8] c9 = self.channels[9] self.assertSameSet(utils.find_relevant_similar_subscription(c1), [c0.id, c2.id, c4.id, c6.id, c9.id]) self.assertSameSet(utils.find_relevant_similar_subscription(c2), [c0.id, c1.id, c8.id]) self.assertSameSet(utils.find_relevant_similar_subscription(c4), [c0.id, c1.id, c6.id, c9.id])
def test_find_relevant_similar_no_ip(self): """ find_relevant_similar without an IP should return all the channels that share a subscription with the given channel. It should not include 0.0.0.0 as a common ip, ignored subscriptions, or non-approved channels. """ c0, c1, c2 = self.channels[:3] c4, c6, c8 = self.channels[4], self.channels[6], self.channels[8] c9 = self.channels[9] self.assertSameSet(utils.find_relevant_similar_subscription(c1), [c0.id, c2.id, c4.id, c6.id, c9.id]) self.assertSameSet(utils.find_relevant_similar_subscription(c2), [c0.id, c1.id, c8.id]) self.assertSameSet(utils.find_relevant_similar_subscription(c4), [c0.id, c1.id, c6.id, c9.id])
def test_find_relevant_similar_subscription(self): """ find_relevant_similar when given an IP address should return the other channels that the ip_address has subscribed to. It should not include channels that are not accepted. or ignored subscriptions. """ c0, c1 = self.channels[:2] c4, c6, c9 = self.channels[4], self.channels[6], self.channels[9] self.assertSameSet( utils.find_relevant_similar_subscription(c1, '1.1.1.1'), [c0.id, c4.id, c6.id, c9.id])
def test_find_relevant_similar_subscription(self): """ find_relevant_similar when given an IP address should return the other channels that the ip_address has subscribed to. It should not include channels that are not accepted. or ignored subscriptions. """ c0, c1 = self.channels[:2] c4, c6, c9 = self.channels[4], self.channels[6], self.channels[9] self.assertSameSet( utils.find_relevant_similar_subscription(c1, '1.1.1.1'), [c0.id, c4.id, c6.id, c9.id])