Example #1
0
    def test_check_if_loggedin(self):
        reg_user95 = RegisteredUser("reg_user95")
        self.users_mng.reg_user_list["reg_user95"] = reg_user95

        self.assertFalse(self.users_mng.check_if_loggedin("reg_user95"))
        reg_user95.loggedin = True
        self.assertTrue(self.users_mng.check_if_loggedin("reg_user95"))
        self.assertFalse(
            self.users_mng.check_if_loggedin("not_registered_user"))

        self.users_mng.reg_user_list.pop("reg_user95")
Example #2
0
    def test_logout(self):
        reg_user10 = RegisteredUser("reg_user10")
        self.users_mng.reg_user_list["reg_user10"] = reg_user10
        reg_user10.loggedin = True
        logout_un = self.users_mng.logout("reg_user10")
        incr = self.users_mng.incremental_id - 1
        self.assertEqual(logout_un, "guestUser" + str(incr))

        logout_un2 = self.users_mng.logout("not_registered")
        self.assertEqual(logout_un2, "not_registered")

        self.users_mng.reg_user_list.pop("reg_user10")