예제 #1
0
파일: run.py 프로젝트: itdxer/flask-test
def fake_books_and_authors():
    print('Create fake books and authors')

    for _ in xrange(5):
        book = Book(name=picka.sentence_actual(min_words=1, max_words=4))
        db_session.add(book)

        for _ in xrange(random.randrange(1, 4)):
            author = Author(name=picka.name())
            db_session.add(author)

            book.authors.append(author)

    db_session.commit()
예제 #2
0
assert picka.trash(picka.male_first)
assert picka.female_first()
assert picka.calling_code()
assert picka.male_first()
assert picka.timestamp()
assert picka.hyphenated_last_name()
assert picka.fax_number()
assert picka.male_full_name()
assert picka.password_alphanumeric(8)
assert picka.birthday()
assert picka.social_security_number()
assert picka.set_of_initials()
assert picka.female_middle()
assert picka.month_and_day()
assert picka.password_alphabetical(8)
assert picka.name()
assert picka.cvv(3)
assert picka.country()
assert picka.age()
assert picka.city_with_state()
assert picka.email()
assert picka.female_name()
assert picka.street_type()
assert picka.suffix()
assert picka.url(10)
assert picka.password_numerical(10)
assert picka.street_address()
assert picka.language()
assert len(picka.barcode("EAN-8")) == 8
assert len(picka.barcode("EAN-13")) == 13
assert picka.locale()
from boston_restaurant.model.restaurant import Restaurant
from boston_restaurant.model.reservation import Reservation
from boston_restaurant.model.food import Food
from boston_restaurant.model.user import User
from boston_restaurant.model.menu import Menu
from boston_restaurant import db

users = []
restaurants = []
reviews = []
foods = []
menus = []
RATING_LEVELS = ['Good', 'Average', 'Bad']
MENU_TYPES = ['Brunch', 'Lunch', 'Dinner']
for i in range(5):
    user = User(nickname=picka.name(), username=picka.email(),
                password='******', phone=picka.phone_number())
    db.session.add(user)
    users.append(user)

db.session.commit()

for line in open('food.txt'):
    parts = line.split('/')
    if len(parts) > 1:
        name, desc = parts[0], parts[1][:140]
    else:
        name, desc = parts[0], ''
    food = Food(name=name, description=desc)
    foods.append(food)
예제 #4
0
파일: tests.py 프로젝트: TadLeonard/picka
print picka.business_title()
print picka.male_middle()
print picka.trash(picka.male_first)
print picka.female_first()
print picka.calling_code()
print picka.male_first()
print picka.timestamp()
print picka.hyphenated_last_name()
print picka.fax_number()
print picka.male_full_name()
print picka.password_alphanumeric(8)
print picka.birthday()
print picka.social_security_number()
print picka.set_of_initials()
print picka.female_middle()
print picka.month_and_day()
print picka.password_alphabetical(8)
print picka.name()
print picka.cvv(3)
print picka.country()
print picka.age()
print picka.city_with_state()
print picka.email()
print picka.female_name()
print picka.street_type()
print picka.suffix()
print picka.url(10)
print picka.password_numerical(10)
print picka.street_address()
print picka.language()
예제 #5
0
파일: tests.py 프로젝트: jisqyv/picka
assert picka.trash(picka.male_first)
assert picka.female_first()
assert picka.calling_code()
assert picka.male_first()
assert picka.timestamp()
assert picka.hyphenated_last_name()
assert picka.fax_number()
assert picka.male_full_name()
assert picka.password_alphanumeric(8)
assert picka.birthday()
assert picka.social_security_number()
assert picka.set_of_initials()
assert picka.female_middle()
assert picka.month_and_day()
assert picka.password_alphabetical(8)
assert picka.name()
assert picka.cvv(3)
assert picka.country()
assert picka.age()
assert picka.city_with_state()
assert picka.email()
assert picka.female_name()
assert picka.street_type()
assert picka.suffix()
assert picka.url(10)
assert picka.password_numerical(10)
assert picka.street_address()
assert picka.language()
assert len(picka.barcode("EAN-8")) == 8
assert len(picka.barcode("EAN-13")) == 13
assert picka.locale()