def METHOD_NAME(self, email_user):
    """
    Tests that updates to state impact the creator group maintained in authz.py and that e-mails are sent.
    """
    def change_state_and_verify_email(state, is_creator):
        """ Changes user state, verifies creator status, and verifies e-mail is sent based on transition """
        self._change_state(state)
        self.assertEqual(is_creator, auth.user_has_role(self.user, CourseCreatorRole()))
        context = {'studio_request_email': self.studio_request_email}
        if state == CourseCreator.GRANTED:
            template = 'emails/course_creator_granted.txt'
        elif state == CourseCreator.DENIED:
            template = 'emails/course_creator_denied.txt'
        else:
            template = 'emails/course_creator_revoked.txt'
        email_user.assert_called_with(
            mock_render_to_string('emails/course_creator_subject.txt', context),
            mock_render_to_string(template, context),
            self.studio_request_email
        )
    with mock.patch.dict('django.conf.settings.FEATURES', self.enable_creator_group_patch):
        # User is initially unrequested.
        self.assertFalse(auth.user_has_role(self.user, CourseCreatorRole()))
        change_state_and_verify_email(CourseCreator.GRANTED, True)
        change_state_and_verify_email(CourseCreator.DENIED, False)
        change_state_and_verify_email(CourseCreator.GRANTED, True)
        change_state_and_verify_email(CourseCreator.PENDING, False)
        change_state_and_verify_email(CourseCreator.GRANTED, True)
        change_state_and_verify_email(CourseCreator.UNREQUESTED, False)
        change_state_and_verify_email(CourseCreator.DENIED, False)