'Runs a state change test.
`before_ideal` and `after_ideal` are SettableEnrollmentState\'s
`action` is a function which will be run in the middle.
`action` should transition the world from before_ideal to after_ideal
`action` will be supplied the following arguments (None-able arguments)
`email` is an email string'

def _run_state_change_test(self, before_ideal, after_ideal, action):

    print 'checking    initialization...'
    eobjs = before_ideal.create_user(self.course_key)
    before = EmailEnrollmentState(self.course_key, eobjs.email)
    self.assertEqual(before, before_ideal)
    print 'running    action...'
    action(eobjs.email)
    print 'checking    effects...'
    after = EmailEnrollmentState(self.course_key, eobjs.email)
    self.assertEqual(after, after_ideal)
