Fixed a broken flask test. Now I add a mock for the stats module before testing.