The grades related unit tests could be better. Suggestions:
1) test_grade_category_set_hidden() should test that hiding the category hides all grade_items within it. Not just the grade item associated with the category itself.
2) Add tests to test grade calculation using the various category aggregation methods.
3) Add tests to test grade calculation after some grade items have been hidden. These should include tests of what grades are displayed to student with "Hide totals if they contain hidden items" set to either hidden, show ex or show inc.
Note that 2 and 3 may need to be combined to allow for easier testing of all category aggregation methods with and without hidden items.