Drobne (myslim) upravy v testutils.
This commit is contained in:
		
							parent
							
								
									c499d823f9
								
							
						
					
					
						commit
						e3d7ee3756
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		|  | @ -270,9 +270,12 @@ def gen_ulohy_do_cisla(rnd, organizatori, resitele, rocnik_cisla, rocniky, size) | ||||||
| 					#print("Generuji {}-té řešení".format(ri)) | 					#print("Generuji {}-té řešení".format(ri)) | ||||||
| 					if rnd.randint(1, 10) == 6: | 					if rnd.randint(1, 10) == 6: | ||||||
| 					# cca desetina řešení od více řešitelů | 					# cca desetina řešení od více řešitelů | ||||||
| 						res_vyber = rnd.sample(resitele_cisla, rnd.randint(2, 5)) | 						res_vyber = rnd.sample(resitele_cisla,  | ||||||
|  | 							rnd.randint(2, 5)) | ||||||
| 					else: | 					else: | ||||||
| 						res_vyber = rnd.sample(resitele_cisla, 1) | 						res_vyber = rnd.sample(resitele_cisla, 1) | ||||||
|  | 					if resitele[0] in res_vyber: | ||||||
|  | 						res_vyber.remove(resitele[0]) | ||||||
| 					res = Reseni.objects.create(forma=rnd.choice(Reseni.FORMA_CHOICES)[0]) | 					res = Reseni.objects.create(forma=rnd.choice(Reseni.FORMA_CHOICES)[0]) | ||||||
| 					# problem a resitele přiřadíme později, ManyToManyField | 					# problem a resitele přiřadíme později, ManyToManyField | ||||||
| 					# se nedá vyplnit v create() | 					# se nedá vyplnit v create() | ||||||
|  | @ -407,7 +410,8 @@ def gen_temata(rnd, rocniky, rocnik_cisla, organizatori): | ||||||
| 	poc_oboru = rnd.randint(1, 2) | 	poc_oboru = rnd.randint(1, 2) | ||||||
| 
 | 
 | ||||||
| 	rocnik_temata = [] | 	rocnik_temata = [] | ||||||
| 	# Věříme, že rocnik_cisla je pole polí čísel podle ročníků, tak si necháme dát vždycky jeden ročník a k němu příslušná čísla. | 	# Věříme, že rocnik_cisla je pole polí čísel podle ročníků, tak si necháme dát  | ||||||
|  | 	# vždycky jeden ročník a k němu příslušná čísla. | ||||||
| 	for rocnik, cisla in zip(rocniky, rocnik_cisla): | 	for rocnik, cisla in zip(rocniky, rocnik_cisla): | ||||||
| 		kod = 1 | 		kod = 1 | ||||||
| 		letosni_temata = [] | 		letosni_temata = [] | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Anet
						Anet