def setUp(self): import datetime today = datetime.date.today() self.u = User(username='******') self.u.save() self.baron = Plane(tailnumber="N1234", type='BE-55') self.baron.save() self.seaplane = Plane(tailnumber="N5678", cat_class=3) self.seaplane.save() self.local_route = Route.from_string('kvta kvta') self.more50nm_route = Route.from_string('kvta kluk') self.no_land_more50nm_route = Route.from_string('kvta @kluk kvta') self.less50nm_route = Route.from_string('kvta kcmh') self.no_land_less50nm_route = Route.from_string('kvta @kcmh kvta') self.f = Flight(total=11.0, pic=10.0, date=today, route=self.local_route)
def render_route(self): """ Completely redo the route object, then update the flight's db record. """ self.route = Route.from_string(self.route_string, user=self.user, date=self.date) self.save(no_badges=True)
def setUp(self): self.p = Plane(tailnumber="N444444", cat_class=4, type="TYPE") self.p.save() self.u = User(username='******') self.u.save() self.f = Flight(plane=self.p, route=Route.from_string('mer-lga'), user=self.u, date='2009-01-05', total=10.0, ) self.f.save()
def setUp(self): self.p = Plane(tailnumber="N444444", cat_class=4, type="TYPE") self.p.save() self.u = User(username='******') self.u.save() self.f = Flight( plane=self.p, route=Route.from_string('mer-lga'), user=self.u, date='2009-01-05', total=10.0, ) self.f.save()