          client = Client(enforce_csrf_checks=True)
          response = client.post('/auth-token/login/', 
                                 {'username': self.username, 'password': self.password})
          self.assertEqual(response.status_code, 200)
          self.assertEqual(json.loads(response.content)['token'], self.key)
 
</s> remove         self.assertEqual(json.loads(response.content)['token'], self.key)
 </s> add         self.assertEqual(json.loads(response.content.decode('ascii'))['token'], self.key) </s> remove         self.assertEquals(resp.content, '%s(%s);' % (callback_func, _flat_repr))
 </s> add         self.assertEquals(resp.content,
            ('%s(%s);' % (callback_func, _flat_repr)).encode('ascii')) </s> remove         self.assertEquals(response.content, "404 Not Found")
 </s> add         self.assertEquals(response.content, six.b("404 Not Found")) </s> remove         self.assertEquals(response.content, "404: Not found")
 </s> add         self.assertEquals(response.content, six.b("404: Not found")) </s> remove         self.assertEquals(response.content, '')
 </s> add         self.assertEquals(response.content, six.b(''))
        self.assertEqual(json.loads(response.content.decode('ascii'))['token'], self.key)
          client = Client(enforce_csrf_checks=True)
          response = client.post('/auth-token/login/', 
                                 {'username': self.username, 'password': self.password})
          self.assertEqual(response.status_code, 200)
        self.assertEqual(json.loads(response.content.decode('ascii'))['token'], self.key)
keep keep keep keep replace
 Every (base) test should now pass with python3. 
rest_framework/tests/authentication.py