Exemple #1
0
    def remove(self):
        'remove'
        article_num = random.randint(1, 10)
        article_dict = common.picker_dict(self.articles, article_num)
        for key in article_dict.keys():
            if key > 0:
                if self.current_article_session.destroy(key):
                    self.articles.pop(key)

        catalog_num = random.randint(1, 10)
        catalog_dict = common.picker_dict(self.catalogs, catalog_num)
        for key in catalog_dict.keys():
            if key > 0:
                if self.current_catalog_session.destroy(key):
                    self.catalogs.pop(key)

        link_num = random.randint(1, 10)
        link_dict = common.picker_dict(self.links, link_num)
        for key in link_dict.keys():
            if key > 0:
                if self.current_link_session.destroy(key):
                    self.links.pop(key)

        media_num = random.randint(1, 10)
        media_dict = common.picker_dict(self.medias, media_num)
        for key in media_dict.keys():
            if key > 0:
                if self.current_media_session.destroy(key):
                    self.medias.pop(key)
Exemple #2
0
    def remove(self):
        'remove'
        article_num = random.randint(1, 10)
        article_dict = common.picker_dict(self.articles, article_num)
        for key in article_dict.keys():
            if key > 0:
                if self.current_article_session.destroy(key):
                    self.articles.pop(key)

        catalog_num = random.randint(1, 10)
        catalog_dict = common.picker_dict(self.catalogs, catalog_num)
        for key in catalog_dict.keys():
            if key > 0:
                if self.current_catalog_session.destroy(key):
                    self.catalogs.pop(key)

        link_num = random.randint(1, 10)
        link_dict = common.picker_dict(self.links, link_num)
        for key in link_dict.keys():
            if key > 0:
                if self.current_link_session.destroy(key):
                    self.links.pop(key)

        media_num = random.randint(1, 10)
        media_dict = common.picker_dict(self.medias, media_num)
        for key in media_dict.keys():
            if key > 0:
                if self.current_media_session.destroy(key):
                    self.medias.pop(key)
Exemple #3
0
    def remove(self):
        'remove'
        user_num = random.randint(1, 10)
        user_dict = common.picker_dict(self.users, user_num)
        for key in user_dict.keys():
            if key > 0:
                if self.current_user_session.destroy(key):
                    self.users.pop(key)

        group_num = random.randint(1, 10)
        group_dict = common.picker_dict(self.groups, group_num)
        for key in group_dict.keys():
            if key > 0:
                if self.current_group_session.destroy(key):
                    self.groups.pop(key)
Exemple #4
0
    def __mock_group(self):
        catalog = common.picker_dict(self.groups, 1)
        catalog = {}
        for _, val in catalog.items():
            catalog = val

        return common.word(), common.paragraph(), catalog
Exemple #5
0
    def __mock_user(self):
        group_num = random.randint(1, 10)
        catalog = common.picker_dict(self.groups, group_num)
        groups = []
        for _, val in catalog.items():
            groups.append(val)

        return common.word(), common.email(), groups
Exemple #6
0
    def __mock_media(self):
        catalog_num = random.randint(1, 10)
        parent_catalog = common.picker_dict(self.catalogs, catalog_num)
        catalogs = []
        for key, val in parent_catalog.items():
            catalogs.append({'id': key, 'name': val['name']})

        return common.title(), common.url(), common.paragraph(), catalogs
Exemple #7
0
    def __mock_media(self):
        catalog_num = random.randint(1, 10)
        parent_catalog = common.picker_dict(self.catalogs, catalog_num)
        catalogs = []
        for key, val in parent_catalog.items():
            catalogs.append({'id':key, 'name': val['name']})

        return common.title(), common.url(), common.paragraph(), catalogs