              self.key = self.generate_key()
          return super(Token, self).save(*args, **kwargs)
  
      def generate_key(self):
          unique = str(uuid.uuid4())
          return hmac.new(unique, digestmod=sha1).hexdigest()
  
      def __unicode__(self):
          return self.key
 
</s> remove         file = BytesIO(b'stuff')
 </s> add         file = BytesIO(six.b('stuff')) </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             for name,value in headers.iteritems():
 </s> add             for name, value in six.iteritems(headers): </s> remove         self.assertEquals(response.content, "403 Forbidden")
 </s> add         self.assertEquals(response.content, six.b("403 Forbidden"))
        unique = uuid.uuid4()
        return hmac.new(unique.bytes, digestmod=sha1).hexdigest()
              self.key = self.generate_key()
          return super(Token, self).save(*args, **kwargs)
  
      def generate_key(self):
        unique = uuid.uuid4()
        return hmac.new(unique.bytes, digestmod=sha1).hexdigest()
        unique = uuid.uuid4()
        return hmac.new(unique.bytes, digestmod=sha1).hexdigest()
  
      def __unicode__(self):
          return self.key
keep keep keep keep replace replace keep keep keep
 Every (base) test should now pass with python3. 
rest_framework/authtoken/models.py