def test_weekly_working_hours_attribute_is_read_only(): """testing if the weekly_working_hours is a read-only attribute """ wh = WorkingHours() with pytest.raises(AttributeError) as cm: wh.weekly_working_hours = 232 assert str(cm.value) == "can't set attribute"
def test_weekly_working_hours_attribute_is_read_only(self): """testing if the weekly_working_hours is a read-only attribute """ wh = WorkingHours() with self.assertRaises(AttributeError) as cm: wh.weekly_working_hours = 232 self.assertEqual(str(cm.exception), "can't set attribute")