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)
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)
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
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
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
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