recalculating only the new hanchans shoud do the trick now.

the racalc cronjob reports erronous partly recalculations now.
A lot of code cleanups
This commit is contained in:
2017-11-01 09:53:52 +01:00
parent 42a6ebedf9
commit abeb86d48f
15 changed files with 87 additions and 62 deletions

View File

@@ -25,7 +25,7 @@ class KyuDanTest(TestCase):
'test_kyu_dan_rankings.json'
]
def recalc(self):
def _test_recalc(self):
"""
Test if a Kyu/Dan Ranking recalculation gives the same result as stored.
@@ -58,10 +58,10 @@ class KyuDanTest(TestCase):
user=ranking.user,
since=ranking.legacy_date
)
if not confirmed_hanchans.count():
continue
rnd = random.randrange(confirmed_hanchans.count())
since = confirmed_hanchans[rnd].start
print(since)
ranking.recalculate(hanchan_start=since)
for attr in self.equal_attrs:
self.assertEqual(