Ejemplo n.º 1
0
    def test_set_frontpaged_user_will_turn_frontpaged_user_false_if_that_user_is_no_longer_frontpaged(self):
        self.get_frontpaged_streamer.return_value = "heyitsleo"
        self._create_local_streamer_account("taddeimania", "taddeimania", frontpaged=True)
        self._create_local_streamer_account("bobzoom", "BoBzoom")

        tasks.set_frontpaged_user(["taddeimania", "BoBzoom"])

        active_streamers = UserProfile.objects.filter(frontpaged=True)
        self.assertEqual(active_streamers.count(), 0)
Ejemplo n.º 2
0
    def test_set_frontpaged_user_will_keep_frontpaged_user_that_is_still_frontpaged_as_frontpaged(self):
        self.get_frontpaged_streamer.return_value = "taddeimania"
        self._create_local_streamer_account("taddeimania", "taddeimania", frontpaged=True)
        self._create_local_streamer_account("bobzoom", "BoBzoom")

        tasks.set_frontpaged_user(["taddeimania", "BoBzoom"])

        active_streamers = UserProfile.objects.filter(frontpaged=True)
        self.assertEqual(active_streamers.count(), 1)
        self.assertEqual(active_streamers[0].livetvusername, "taddeimania")
Ejemplo n.º 3
0
    def test_set_frontpaged_user_will_mark_frontpaged_user_that_is_not_frontpaged_as_frontpaged(
            self):
        self.get_frontpaged_streamer.return_value = "taddeimania"
        self._create_local_streamer_account("taddeimania", "taddeimania")
        self._create_local_streamer_account("bobzoom", "BoBzoom")

        tasks.set_frontpaged_user(["taddeimania", "BoBzoom"])

        active_streamers = UserProfile.objects.filter(frontpaged=True)
        self.assertEqual(active_streamers.count(), 1)
        self.assertEqual(active_streamers[0].livetvusername, "taddeimania")
Ejemplo n.º 4
0
    def test_set_frontpaged_user_will_turn_frontpaged_user_false_if_that_user_is_no_longer_frontpaged(
            self):
        self.get_frontpaged_streamer.return_value = "heyitsleo"
        self._create_local_streamer_account("taddeimania",
                                            "taddeimania",
                                            frontpaged=True)
        self._create_local_streamer_account("bobzoom", "BoBzoom")

        tasks.set_frontpaged_user(["taddeimania", "BoBzoom"])

        active_streamers = UserProfile.objects.filter(frontpaged=True)
        self.assertEqual(active_streamers.count(), 0)