Ejemplo n.º 1
0
    def test_get_current_time_zone(self, user_preferences, expected_time_zone):
        """Verify get_current_time_zone returns correct time zone or UTC"""
        user_service = WorkBenchUserService(3)
        user_service.get_current_user(
        ).opt_attrs['edx-platform.user_preferences'] = user_preferences

        time_zone = get_current_time_zone(user_service)
        self.assertEqual(expected_time_zone, time_zone)
Ejemplo n.º 2
0
    def test_get_user_preferences(self, user_preferences, expected_timezone, expected_language):
        """Verify get_user_preferences returns correct time zone and language"""
        user_service = WorkBenchUserService(3)
        user_service.get_current_user().opt_attrs['edx-platform.user_preferences'] = user_preferences

        user_preferences = get_user_preferences(user_service)
        self.assertEqual(expected_timezone, user_preferences['user_timezone'])
        self.assertEqual(expected_language, user_preferences['user_language'])
Ejemplo n.º 3
0
    def test_get_user_preferences(self, user_preferences, expected_timezone, expected_language):
        """Verify get_user_preferences returns correct time zone and language"""
        user_service = WorkBenchUserService(3)
        user_service.get_current_user().opt_attrs['edx-platform.user_preferences'] = user_preferences

        user_preferences = get_user_preferences(user_service)
        self.assertEqual(expected_timezone, user_preferences['user_timezone'])
        self.assertEqual(expected_language, user_preferences['user_language'])