I believe @gwprice had had luck using patch.dict from the mock library to
just override a single feature flag. We could also write our own decorator
for feature flags, since it's a common usecase.

-Cale
On Jun 4, 2013 6:22 PM, "Kevin Luo" <notifications@github.com> wrote:

> In lms/djangoapps/bulk_email/tests/tests.py:
>
> > +        self.instructor = 'view@test.com'
> > +        self.password = 'foo'
> > +        self.create_account('u1', self.instructor, self.password)
> > +        self.activate_user(self.instructor)
> > +
> > +        group_name = _course_staff_group_name(self.toy.location)
> > +        g = Group.objects.create(name=group_name)
> > +        g.user_set.add(get_user(self.instructor))
> > +
> > +        self.logout()
> > +        self.login(self.instructor, self.password)
> > +        self.enroll(self.toy)
> > +
> > +    def test_email_flag_true(self):
> > +        oldEmailFlag = settings.MITX_FEATURES['ENABLE_INSTRUCTOR_EMAIL']
> > +        settings.MITX_FEATURES['ENABLE_INSTRUCTOR_EMAIL'] = True
>
> I can't use override_settings here because I'm just changing one pair of
> the MITX_FEATURES dictionary, and it can't take in a dict key expression. I
> think it would only work if I overrode the entire MITX_FEATURES dictionary.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/edx/edx-platform/pull/30/files#r4534930>
> .
>