# HG changeset patch # User Daniele Nicolodi # Date 1318801121 -7200 # Node ID 2827664bb78584e4593c356f3a6c5cb25e7d0b1e # Parent f3ee09b031dde5de535d6c0667697009daaec5a8 Randomize test objects submission time. diff -r f3ee09b031dd -r 2827664bb785 src/ltpdarepo/admin.py --- a/src/ltpdarepo/admin.py Sun Oct 16 23:38:32 2011 +0200 +++ b/src/ltpdarepo/admin.py Sun Oct 16 23:38:41 2011 +0200 @@ -274,7 +274,6 @@ nsecs = 100 t0 = datetime(1970, 1, 1, 0, 0, 0) - submitted = datetime.utcnow() - timedelta(hours=3 * nobjs) for i in range(nobjs): @@ -282,6 +281,7 @@ title = ' '.join(words[0:2]) description = random.choice(sentences) analysis = random.choice(sentences) + submitted = datetime.utcnow() - timedelta(days=random.randint(0, nobjs / 10.0)) curs.execute("""INSERT INTO objs (uuid) VALUES (%s)""", (str(uuid.uuid4()))) objid = curs.lastrowid @@ -299,7 +299,7 @@ curs.execute("""INSERT INTO tsdata (obj_id, fs, t0, nsecs) VALUES (%s, %s, %s, %s)""", (objid, 10, t0, nsecs)) t0 += timedelta(seconds=nsecs) - submitted += timedelta(hours=3) + conn.commit() cmd = commands.add(populate)