def test_ready_enable_theming(self): """ Tests that method `ready` invokes `enable_theming` method """ config = ThemeAppConfig('theming', theming) with mock.patch('ecommerce.theming.apps.enable_theming') as mock_enable_theming: config.ready() self.assertTrue(mock_enable_theming.called)
def test_ready_with_theming_disabled(self): """ Tests that method `ready` does not invoke `enable_theming` method when theming is disabled """ config = ThemeAppConfig('theming', theming) with mock.patch('ecommerce.theming.apps.enable_theming') as mock_enable_theming: config.ready() self.assertFalse(mock_enable_theming.called)
def test_ready_enable_theming(self): """ Tests that method `ready` invokes `enable_theming` method """ themes_dir = Path(settings.COMPREHENSIVE_THEME_DIR) config = ThemeAppConfig('theming', theming) with mock.patch('ecommerce.theming.apps.enable_theming') as mock_enable_theming: config.ready() self.assertTrue(mock_enable_theming.called) mock_enable_theming.assert_called_once_with(themes_dir=themes_dir)
def test_ready_enable_theming(self): """ Tests that method `ready` invokes `enable_theming` method """ themes_dir = Path(settings.COMPREHENSIVE_THEME_DIR) config = ThemeAppConfig('theming', theming) with mock.patch('ecommerce.theming.apps.enable_theming' ) as mock_enable_theming: config.ready() self.assertTrue(mock_enable_theming.called) mock_enable_theming.assert_called_once_with(themes_dir=themes_dir)