'Tests microsite.enable_microsites works as expected.'

@patch('edxmako.paths.add_lookup')
def test_enable_microsites(self, add_lookup):

    settings.STATICFILES_DIRS = [path for path in settings.STATICFILES_DIRS if (path != settings.MICROSITE_ROOT_DIR)]
    with patch.dict('django.conf.settings.FEATURES', {'USE_MICROSITES': False}):
        microsite.enable_microsites(log)
        self.assertNotIn(settings.MICROSITE_ROOT_DIR, settings.STATICFILES_DIRS)
        add_lookup.assert_not_called()
    with patch.dict('django.conf.settings.FEATURES', {'USE_MICROSITES': True}):
        microsite.enable_microsites(log)
        self.assertIn(settings.MICROSITE_ROOT_DIR, settings.STATICFILES_DIRS)
