def create_competitors(self, count): for ii in range(count): competitor = Competitor( competition=self.competition, name=u'Runner {} {}'.format(make_random_code(4), ii+1), short_name=u"R{}".format(ii+1), start_time=self.competition.start_date+timedelta(seconds=60*ii), approved=True, ) competitor.save()
def create_competition(self, live_delay): competition = Competition( publisher=self.publisher, name=u'Fake Live {}'.format(make_random_code(5)), live_delay=live_delay, latitude=62, longitude=22, zoom=12, publication_policy='public', signup_policy='closed', start_date=now(), end_date=now()+timedelta(seconds=3600*4), timezone='Europe/Helsinki', ) competition.save() self.competition = competition
def generate_key(): return make_random_code(32)
def generate_access_code(): return make_random_code(settings.SEURANTA_ACCESS_CODE_LENGTH)
def create_publisher(self): self.publisher = User.objects.create_user( u'Fake {}'.format(make_random_code(5)) )