@render_to('distributed/loadtesting/load_test.html')
def load_test(request, nusers=None):
 username = uuid.uuid4().hex[:12]
 if (not Facility.objects.count()):
  fac = Facility.objects.create(name='fac')
 fac = Facility.objects.all()[0]
 (user, _) = FacilityUser.get_or_initialize(username=username, facility=fac)
 user.set_password(username)
 user.save()
 return {'pct_videos': request.GET.get('pct_videos', 0.3), 'username': username}

@ render_to ( 'distributed/loadtesting/load_test.html' ) def load_test ( request , nusers = None ) : username = uuid . uuid4 ( ) . hex [ : 12 ] if ( not Facility . objects . count ( ) ) : fac = Facility . objects . create ( name = 'fac' ) fac = Facility . objects . all ( ) [ 0 ] ( user , _ ) = FacilityUser . get_or_initialize ( username = username , facility = fac ) user . set_password ( username ) user . save ( ) return { 'pct_videos' : request . GET . get ( 'pct_videos' , 0.3 ) , 'username' : username }
the principal purpose of this view is to allow the automated testing of multiple clients connected to the server at once .