              # the default manager on teachers to immediately get all the related
              # qualifications, since this will do one query per teacher.
              qs = Department.objects.prefetch_related('teachers')
              depts = "".join("%s department: %s\n" %
                              (dept.name, ", ".join(six.text_type(t) for t in dept.teachers.all()))
                              for dept in qs)
  
              self.assertEqual(depts,
                               "English department: Mr Cleese (BA, BSci, MA, PhD), Mr Idle (BA)\n"
                               "Physics department: Mr Cleese (BA, BSci, MA, PhD), Mr Chapman (BSci)\n")
 
</s> remove         return "%s (%s)" % (self.revision, six.text_type(self.repository))
 </s> add         return "%s (%s)" % (self.revision, str(self.repository)) </s> remove             lst = [[six.text_type(book) for book in author.books_with_year.all()] for author in qs]
 </s> add             lst = [[str(book) for book in author.books_with_year.all()] for author in qs] </s> remove         lst2 = [[six.text_type(book) for book in author.books_with_year.all()] for author in qs]
 </s> add         lst2 = [[str(book) for book in author.books_with_year.all()] for author in qs] </s> remove # Removing the temporary TMPDIR. Ensure we pass in unicode so that it will
# successfully remove temp trees containing non-ASCII filenames on Windows.
# (We're assuming the temp dir name itself only contains ASCII characters.)
atexit.register(shutil.rmtree, six.text_type(TMPDIR))
 </s> add # Removing the temporary TMPDIR.
atexit.register(shutil.rmtree, TMPDIR) </s> remove             lst = [[six.text_type(author) for author in book.aged_authors.all()] for book in qs]
 </s> add             lst = [[str(author) for author in book.aged_authors.all()] for book in qs]
                            (dept.name, ", ".join(str(t) for t in dept.teachers.all()))
              # the default manager on teachers to immediately get all the related
              # qualifications, since this will do one query per teacher.
              qs = Department.objects.prefetch_related('teachers')
              depts = "".join("%s department: %s\n" %
                            (dept.name, ", ".join(str(t) for t in dept.teachers.all()))
                              for dept in qs)
  
              self.assertEqual(depts,
                               "English department: Mr Cleese (BA, BSci, MA, PhD), Mr Idle (BA)\n"
                               "Physics department: Mr Cleese (BA, BSci, MA, PhD), Mr Chapman (BSci)\n")
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/prefetch_related/tests.py