testutils: oprava nefungujicich veci
This commit is contained in:
parent
dc574d9185
commit
f30392d92b
1 changed files with 11 additions and 13 deletions
|
@ -117,9 +117,7 @@ def gen_organizatori(osoby, last_rocnik):
|
|||
return organizatori
|
||||
|
||||
def gen_ulohy_do_cisla(cislo, organizatori, resitele, slovnik_cisel, size):
|
||||
'''
|
||||
cislo = cislo cisla v rocniku, nikoli objekt Cislo
|
||||
'''
|
||||
'''cislo = cislo cisla v rocniku, nikoli objekt Cislo '''
|
||||
# ulohy resene v ci
|
||||
jaka = ["Šachová", "Černá", "Větrná", "Dlouhá", "Křehká", "Rychlá",
|
||||
"Zákeřná", "Fyzikální"]
|
||||
|
@ -165,11 +163,11 @@ cislo = cislo cisla v rocniku, nikoli objekt Cislo
|
|||
poc_resitel = rnd.randint(1, 3)
|
||||
res_sel = rnd.sample(resitele, min(poc_reseni, len(resitele) - 2))
|
||||
for resitel in res_sel:
|
||||
res = Reseni.objects.create(problem = p,
|
||||
resitele=[resitel],
|
||||
forma=rnd.choice(Reseni.FORMA_CHOICES))
|
||||
hod = Hodnoceni.objects.create(body=rnd.randint(0, p.max_body),
|
||||
cislo_body=slovnik_cisel[cislo], reseni=res, problem=p)
|
||||
res = Reseni.objects.create(problem = p,
|
||||
resitele=[resitel],
|
||||
forma=rnd.choice(Reseni.FORMA_CHOICES))
|
||||
hod = Hodnoceni.objects.create(body=rnd.randint(0, p.max_body),
|
||||
cislo_body=slovnik_cisel[cislo], reseni=res, problem=p)
|
||||
return
|
||||
|
||||
|
||||
|
@ -280,17 +278,17 @@ def create_test_data(size = 6, rnd = None):
|
|||
cislo_reseni=slovnik_cisel[cislo],
|
||||
cislo_deadline=slovnik_cisel[cislo],
|
||||
max_body = rnd.randint(1, 8))
|
||||
p.zadani = " ".join([rnd.choice(sloveso), rnd.choice(koho),
|
||||
rnd.choice(ceho), rnd.choice(jmeno), rnd.choice(kde)])
|
||||
p.vzorak = " - ".join([p.zadani, rnd.choice(reseni)])
|
||||
p.save()
|
||||
p.zadani = " ".join([rnd.choice(sloveso), rnd.choice(koho),
|
||||
rnd.choice(ceho), rnd.choice(jmeno), rnd.choice(kde)])
|
||||
p.vzorak = " - ".join([p.zadani, rnd.choice(reseni)])
|
||||
p.save()
|
||||
|
||||
|
||||
# vytvor text
|
||||
# vytvor TemaVCisleNode
|
||||
if (rnd.randint(1, 3) % 3 == 0):
|
||||
# vytvor mezicislo Node
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue