remove xrange and unused variables

This commit is contained in:
Stefan Wojcik
2016-12-09 00:08:59 -05:00
parent 6eb470a821
commit e50b23f047
10 changed files with 58 additions and 57 deletions

View File

@@ -689,7 +689,7 @@ class FieldTest(unittest.TestCase):
LogEntry.drop_collection()
# create 60 log entries
for i in xrange(1950, 2010):
for i in range(1950, 2010):
d = datetime.datetime(i, 01, 01, 00, 00, 01)
LogEntry(date=d).save()
@@ -763,7 +763,7 @@ class FieldTest(unittest.TestCase):
# Pre UTC microseconds above 1000 is wonky - with default datetimefields
# log.date has an invalid microsecond value so I can't construct
# a date to compare.
for i in xrange(1001, 3113, 33):
for i in range(1001, 3113, 33):
d1 = datetime.datetime(1969, 12, 31, 23, 59, 59, i)
log.date = d1
log.save()
@@ -773,7 +773,7 @@ class FieldTest(unittest.TestCase):
self.assertEqual(log, log1)
# Test string padding
microsecond = map(int, [math.pow(10, x) for x in xrange(6)])
microsecond = map(int, [math.pow(10, x) for x in range(6)])
mm = dd = hh = ii = ss = [1, 10]
for values in itertools.product([2014], mm, dd, hh, ii, ss, microsecond):
@@ -806,7 +806,7 @@ class FieldTest(unittest.TestCase):
LogEntry.drop_collection()
# create 60 log entries
for i in xrange(1950, 2010):
for i in range(1950, 2010):
d = datetime.datetime(i, 01, 01, 00, 00, 01, 999)
LogEntry(date=d).save()
@@ -3130,7 +3130,7 @@ class FieldTest(unittest.TestCase):
self.db['mongoengine.counters'].drop()
Person.drop_collection()
for x in xrange(10):
for x in range(10):
Person(name="Person %s" % x).save()
c = self.db['mongoengine.counters'].find_one({'_id': 'person.id'})
@@ -3154,7 +3154,7 @@ class FieldTest(unittest.TestCase):
self.db['mongoengine.counters'].drop()
Person.drop_collection()
for x in xrange(10):
for x in range(10):
Person(name="Person %s" % x).save()
self.assertEqual(Person.id.get_next_value(), 11)
@@ -3169,7 +3169,7 @@ class FieldTest(unittest.TestCase):
self.db['mongoengine.counters'].drop()
Person.drop_collection()
for x in xrange(10):
for x in range(10):
Person(name="Person %s" % x).save()
self.assertEqual(Person.id.get_next_value(), '11')
@@ -3185,7 +3185,7 @@ class FieldTest(unittest.TestCase):
self.db['mongoengine.counters'].drop()
Person.drop_collection()
for x in xrange(10):
for x in range(10):
Person(name="Person %s" % x).save()
c = self.db['mongoengine.counters'].find_one({'_id': 'jelly.id'})
@@ -3210,7 +3210,7 @@ class FieldTest(unittest.TestCase):
self.db['mongoengine.counters'].drop()
Person.drop_collection()
for x in xrange(10):
for x in range(10):
Person(name="Person %s" % x).save()
c = self.db['mongoengine.counters'].find_one({'_id': 'person.id'})
@@ -3272,7 +3272,7 @@ class FieldTest(unittest.TestCase):
Animal.drop_collection()
Person.drop_collection()
for x in xrange(10):
for x in range(10):
Animal(name="Animal %s" % x).save()
Person(name="Person %s" % x).save()
@@ -3302,7 +3302,7 @@ class FieldTest(unittest.TestCase):
self.db['mongoengine.counters'].drop()
Person.drop_collection()
for x in xrange(10):
for x in range(10):
p = Person(name="Person %s" % x)
p.save()