From a66cdbd2345316a10b097852ff3426d2aa29ba89 Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Sat, 28 Mar 2015 15:38:22 +0100 Subject: [PATCH] Vylepseni generovani test. dat --- seminar/tests.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/seminar/tests.py b/seminar/tests.py index aa3753f4..b70512ae 100644 --- a/seminar/tests.py +++ b/seminar/tests.py @@ -33,11 +33,17 @@ def create_test_data(): Skola.objects.create(mesto = u'Humenné', stat='SK', psc='012 34', ulice=u'Pltká 1', nazev=u'Sredná škuola') # resitele + jmena_m = ['Aleš', 'Tomáš', 'Martin', 'Jakub', 'Petr', 'Lukáš', 'Cyril'] + jmena_f = ['Eva', 'Karolína', 'Zuzana', 'Sylvie', 'Iva', 'Jana', 'Marie'] + prijmeni_m = ['Novotný', 'Svoboda', 'Pecha', 'Kořen', 'Holan', 'Uhlíř', 'Chytráček', 'Pokora', 'Koch', 'Szegedy', 'Rudý'] + prijmeni_f = ['Novotná', 'Svobodová', 'Machová', 'Zelená', 'Yu-Xin', 'Mlsná', 'Dubná', 'Mrkvová', 'Suchá', 'Lovelace', 'Holcová'] for i in range(20): skola = rnd.choice(Skola.objects.all()) pohlavi = rnd.randint(0,1) + jmeno = rnd.choice([jmena_m, jmena_f][pohlavi]) + prijmeni = rnd.choice([prijmeni_m, prijmeni_f][pohlavi]) Resitel.objects.create(skola = skola, datum_prihlaseni = datetime.date(rnd.randint(2002, 2014), rnd.randint(1,12), 1), - jmeno = u'Řešitel' if pohlavi else u'Řešitelka', prijmeni = 'Číslo-%s' % (i), rok_maturity = rnd.randint(2015, 2019), + jmeno =jmeno, prijmeni = prijmeni, rok_maturity = rnd.randint(2015, 2019), stat = skola.stat, zasilat = Resitel.ZASILAT_NIKAM, pohlavi_muz = pohlavi) resitele = list(Resitel.objects.all())