How to use the mimesis.Text function in mimesis

To help you get started, we’ve selected a few mimesis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github test-mile / arjuna / arjuna / engine / data / generator.py View on Github external
def sentence(cls, locale=Locales.EN):
        return Text(locale).sentence()
github evereux / flicket / populate_database_with_junk.py View on Github external
def create_ticket_reply(new_ticket):
    t = Text()

    new_reply = FlicketPost(
        ticket=new_ticket,
        content=t.text(randint(3, 15)),
        user=get_random_user(),
        date_added=datetime.datetime.now()
    )

    new_reply.user.total_posts += 1

    db.session.add(new_reply)
github mushorg / tanner / tanner / utils / base_db_helper.py View on Github external
for token in token_list:
                person = mimesis.Person()
                if token == 'I':
                    values.append(i)
                if token == 'L':
                    data = person.username()
                    values.append(data)
                if token == 'E':
                    data = person.email()
                    values.append(data)
                if token == 'P':
                    data = person.password()
                    values.append(data)
                if token == 'T':
                    sample_length = random.randint(1, 10)
                    data = mimesis.Text().text(quantity=sample_length)
                    values.append(data)
            inserted_data.append(tuple(values))

        return inserted_data, token_list
github evereux / flicket / populate_database_with_junk.py View on Github external
def topic_creation(num_topics_):
    # if the number of topics is already satisfied don't add any more.
    topic_count = FlicketTicket.query.count()
    if topic_count >= num_topics_:
        print('Topic number already satisfied')
        return
    else:
        num_topics_ = num_topics_ - topic_count

    for i in range(topic_count, num_topics_):

        t = Text()

        new_ticket = FlicketTicket(
            title=t.title()[0:field_size['title_max_length']],
            content=t.text(randint(3, 15)),
            user=get_random_user(),
            date_added=datetime.datetime.now(),
            current_status=get_random_status(),
            ticket_priority=get_random_priority(),
            category=get_random_category(),
            assigned=get_random_user()
        )

        new_ticket.user.total_posts += 1

        db.session.add(new_ticket)
        mess_1 = "#{}: ticket ....".format(i)