'Verify that the email_opt_in parameter sets the underlying flag.
And that if the argument is not present, then it does not affect the flag'

@ddt.data((True, u'True'), (False, u'False'), (None, None))
@ddt.unpack
def test_email_opt_in_true(self, opt_in, pref_value):

    def _assert_no_opt_in_set():
        "    Check    the    tag    doesn't    exit"
        with self.assertRaises(UserOrgTag.DoesNotExist):
            UserOrgTag.objects.get(user=self.user, org=self.course.id.org, key='email-optin')
    _assert_no_opt_in_set()
    self.assert_enrollment_status(email_opt_in=opt_in)
    if (opt_in is None):
        _assert_no_opt_in_set()
    else:
        preference = UserOrgTag.objects.get(user=self.user, org=self.course.id.org, key='email-optin')
        self.assertEquals(preference.value, pref_value)
