示例#1
0
 def test_plugin_cache(self):
     """ Test plugin registry """
     from merengue.registry.managers import _registry_lookup_cache
     register_plugin('feedback')
     # the feedback block is empty when registering
     self.assertTrue(('plugins.feedback.blocks.FeedbackBlock', ) not in _registry_lookup_cache._cache)
     self.assertTrue(('plugins.feedback.config.PluginConfig', ) in _registry_lookup_cache._cache and \
                     _registry_lookup_cache._cache[('plugins.feedback.config.PluginConfig', )])
 def forwards(self, orm):
     "Write your forwards methods here."
     from django.conf import settings
     from johnny import cache
     from merengue.pluggable import register_plugin
     from merengue.pluggable.utils import install_plugin
     # Unpatch cache backend to disable johnny cache. Johny does weird things
     query_cache_backend = cache.get_backend()
     query_cache_backend.unpatch()
     from django.db import transaction
     for plug_dir in settings.DEMO_PLUGINS:
         plugin = register_plugin(plug_dir)
         plugin.installed = True
         plugin.active = True
         plugin.save()
         install_plugin(plugin)
         transaction.commit()