              .select_related()
              .order_by('id')
          )
          self.assertEqual(
              [(c.id, six.text_type(c.start), six.text_type(c.end)) for c in connections],
              [(c1.id, 'router/4', 'switch/7'), (c2.id, 'switch/7', 'server/1')]
          )
  
          # This final query should only have seven tables (port, device and building
          # twice each, plus connection once). Thus, 6 joins plus the FROM table.
 
</s> remove             [(c.id, six.text_type(c.start), six.text_type(c.end)) for c in connections],
 </s> add             [(c.id, str(c.start), str(c.end)) for c in connections], </s> remove         # Empty strings should be returned as Unicode
 </s> add         # Empty strings should be returned as string </s> remove         if isinstance(file, six.string_types) or file is None:
 </s> add         if isinstance(file, str) or file is None: </s> remove         if not isinstance(query, six.string_types):
 </s> add         if not isinstance(query, str): </s> remove                     ([six.text_type(self.author2)], [six.text_type(self.author3)]),
                    ([six.text_type(self.author3)], [six.text_type(self.author1)]),
                    ([six.text_type(self.author1)], [six.text_type(self.author2)])
 </s> add                     ([str(self.author2)], [str(self.author3)]),
                    ([str(self.author3)], [str(self.author1)]),
                    ([str(self.author1)], [str(self.author2)])
            [(c.id, str(c.start), str(c.end)) for c in connections],
              .select_related()
              .order_by('id')
          )
          self.assertEqual(
            [(c.id, str(c.start), str(c.end)) for c in connections],
              [(c1.id, 'router/4', 'switch/7'), (c2.id, 'switch/7', 'server/1')]
          )
  
          # This final query should only have seven tables (port, device and building
          # twice each, plus connection once). Thus, 6 joins plus the FROM table.
keep keep keep keep replace keep keep keep keep keep
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
tests/select_related_regress/tests.py