Esempio n. 1
0
 def handle(self, *args, **kwargs):
     if not settings.DEBUG:
         raise CommandError('You can only run this command with your '
                            'DEBUG setting set to True.')
     num = int(args[0])
     email = kwargs.get('email')
     generate_themes(num, email)
Esempio n. 2
0
 def handle(self, *args, **kwargs):
     if not settings.DEBUG:
         raise CommandError('You can only run this command with your '
                            'DEBUG setting set to True.')
     num = int(args[0])
     email = kwargs.get('email')
     generate_themes(num, email)
Esempio n. 3
0
    def handle(self, *args, **kwargs):
        if not settings.DEBUG:
            raise CommandError('You can only run this command with your '
                               'DEBUG setting set to True.')
        num = int(kwargs.get('num'))
        email = kwargs.get('email')

        with translation.override(settings.LANGUAGE_CODE):
            generate_themes(num, email)
Esempio n. 4
0
    def handle(self, *args, **kwargs):
        if not settings.DEBUG:
            raise CommandError('You can only run this command with your '
                               'DEBUG setting set to True.')
        num = int(kwargs.get('num'))
        email = kwargs.get('email')

        with translation.override(settings.LANGUAGE_CODE):
            generate_themes(num, email)
Esempio n. 5
0
    def create_featured_themes(self):
        """Creates exactly 6 themes that will be not featured.

        These belong to the user uitest.

        It will also create 6 themes that are featured with random authors.

        """
        generate_themes(6, '*****@*****.**')
        for _ in range(6):
            addon = addon_factory(status=STATUS_PUBLIC, type=ADDON_PERSONA)
            generate_collection(addon, app=FIREFOX)
Esempio n. 6
0
def themes(transactional_db, create_superuser, pytestconfig):
    """Creates exactly 6 themes that will be not featured.

    These belong to the user created by the 'create_superuser' fixture.
    It will also create 6 themes that are featured with random authors.
    """
    if not pytestconfig.option.usingliveserver:
        return

    owner = UserProfile.objects.get(username='******')
    generate_themes(6, owner)
    for _ in range(6):
        addon = addon_factory(status=STATUS_PUBLIC, type=ADDON_PERSONA)
        generate_collection(addon, app=FIREFOX)
Esempio n. 7
0
def themes(transactional_db, create_superuser, pytestconfig):
    """Creates exactly 6 themes that will be not featured.

    These belong to the user created by the 'create_superuser' fixture.
    It will also create 6 themes that are featured with random authors.
    """
    if not pytestconfig.option.usingliveserver:
        return

    owner = UserProfile.objects.get(username='******')
    generate_themes(6, owner)
    for _ in range(6):
        addon = addon_factory(status=STATUS_PUBLIC, type=ADDON_PERSONA)
        generate_collection(addon, app=FIREFOX)