Changed code to be Python 3 compatible

Fixed depreciation warnings caused by assertEquals(...)