def test_create_installable_addon(self): Group.objects.get_or_create(pk=1, defaults={'name': 'Admins', 'rules': '*:*'}) AppVersion.objects.create(application=amo.FIREFOX.id, version='42.0') AppVersion.objects.create(application=amo.FIREFOX.id, version='*') AppVersion.objects.create(application=amo.ANDROID.id, version='48.0') AppVersion.objects.create(application=amo.ANDROID.id, version='*') serializer = GenerateAddonsSerializer() # This should not raise. serializer.create_installable_addon()
def handle(self, *args, **kwargs): # Disconnect reindexing for every save, we'll reindex # once all addons were generated post_save.disconnect(update_search_index, sender=Addon, dispatch_uid='addons.search.index') with override_settings(CELERY_TASK_ALWAYS_EAGER=True): translation.activate('en-US') serializer = GenerateAddonsSerializer() serializer.create_generic_featured_addons() serializer.create_featured_addon_with_version() serializer.create_featured_theme() serializer.create_featured_collections() serializer.create_featured_themes() for addon in base_collections: serializer.create_a_named_collection_and_addon( addon, author='mozilla') for addon in hero_addons: serializer.create_a_named_collection_and_addon( addon, author='mozilla') for addon in hero_addons: serializer.create_named_addon_with_author(addon) serializer.create_installable_addon()
def handle(self, *args, **kwargs): with override_settings(CELERY_ALWAYS_EAGER=True): translation.activate('en-US') serializer = GenerateAddonsSerializer() serializer.create_generic_featured_addons() serializer.create_featured_addon_with_version() serializer.create_featured_theme() serializer.create_featured_collections() serializer.create_featured_themes() for addon in featured_collections: serializer.create_a_named_collection_and_addon( addon, author='mozilla') for addon in base_collections: serializer.create_a_named_collection_and_addon( addon, author='mozilla') for addon in hero_addons: serializer.create_named_addon_with_author(addon) serializer.create_installable_addon() cache.clear() call_command('clear_cache')
def handle(self, *args, **kwargs): with override_settings(CELERY_ALWAYS_EAGER=True): translation.activate('en-US') serializer = GenerateAddonsSerializer() serializer.create_generic_featured_addons() serializer.create_featured_addon_with_version() serializer.create_featured_theme() serializer.create_featured_collections() serializer.create_featured_themes() for addon in featured_collections: serializer.create_a_named_collection_and_addon( addon, author='mozilla') for addon in base_collections: serializer.create_a_named_collection_and_addon( addon, author='mozilla') for addon in hero_addons: serializer.create_named_addon_with_author(addon) serializer.create_installable_addon() cache.clear() call_command('clear_cache')
def handle(self, *args, **kwargs): translation.activate('en-US') serializer = GenerateAddonsSerializer() serializer.create_generic_featured_addons() serializer.create_featured_addon_with_version() serializer.create_featured_theme() serializer.create_featured_collections() serializer.create_featured_themes() cache.clear() call_command('clear_cache')
def handle(self, *args, **kwargs): # Disconnect reindexing for every save, we'll reindex # once all addons were generated post_save.disconnect(update_search_index, sender=Addon, dispatch_uid='addons.search.index') with override_settings(CELERY_ALWAYS_EAGER=True): translation.activate('en-US') serializer = GenerateAddonsSerializer() serializer.create_generic_featured_addons() serializer.create_featured_addon_with_version() serializer.create_featured_theme() serializer.create_featured_collections() serializer.create_featured_themes() for addon in featured_collections: serializer.create_a_named_collection_and_addon( addon, author='mozilla') for addon in base_collections: serializer.create_a_named_collection_and_addon( addon, author='mozilla') for addon in hero_addons: serializer.create_named_addon_with_author(addon) serializer.create_installable_addon()
def handle(self, *args, **kwargs): with override_settings(CELERY_ALWAYS_EAGER=True): translation.activate('en-US') serializer = GenerateAddonsSerializer() serializer.create_generic_featured_addons() serializer.create_featured_addon_with_version() serializer.create_featured_theme() serializer.create_featured_collections() serializer.create_featured_themes() serializer.create_installable_addon() cache.clear() call_command('clear_cache')
def handle(self, *args, **kwargs): translation.activate('en-US') serializer = GenerateAddonsSerializer() serializer.create_generic_featured_addons() serializer.create_featured_addon_with_version() serializer.create_featured_theme() serializer.create_featured_collections() serializer.create_featured_themes() cache.clear() call_command('clear_cache')