old_contents: from datetime import timedelta
  
  import pytest
  
  from django.urls import reverse
  from django.core.files.uploadedfile import SimpleUploadedFile
  from django.utils import timezone
  
  from conference.models import TALK_STATUS, TALK_LEVEL
  from p3.templatetags import sessions
  from tests.factories import UserFactory, TalkFactory, ConferenceTagFactory, TalkSpeakerFactory, SpeakerFactory
  from tests.common_tools import get_default_conference, redirects_to, template_used, make_user
  
  pytestmark = [pytest.mark.django_db]
  
  
  def test_spealers_templatetag():
      names = [
          # these 2 should not be listed
          ("To Be", "Announced"),
          ("Tobey", "Announced"),
          # these 2 should be groupped under D
          ("Dan", "Schmoe"),
          ("Đan", "Again"),
          # these 2 should be groupped under A
          ("Anna", "Doe"),
          ("Ändy", "Unicode"),
          # Make sure we preserve unicode for non-latin names.
          # the numbers are here to work around quirks of how the atendeeprofile slugs are generated by the factory
          ("艾", "未未1"),
          ("Никола", "Тесла2"),
      ]
      conf = get_default_conference()
      speakers = [
          TalkSpeakerFactory(
              speaker__user=make_user(first_name=f_name, last_name=l_name),
              talk__status='accepted',
          )
          for (i, (f_name, l_name)) in enumerate(names)
      ]
      data = sessions.speakers(conf.code)
      assert set(data['groups'].keys()) == {
          'A',
          'D',
          '艾',
          'Н',  # this is not an H it's https://en.wikipedia.org/wiki/En_(Cyrillic)
      }
      assert [s['fullname'] for s in data['groups']['D']] == ["Đan Again", "Dan Schmoe"]
      assert [s['fullname'] for s in data['groups']['A']] == ["Ändy Unicode", "Anna Doe"]
      assert [s['fullname'] for s in data['groups']['艾']] == ["艾 未未1"]
      assert [s['fullname'] for s in data['groups']['Н']] == ["Никола Тесла2"]
  
new_contents: import pytest
  
  from p3.templatetags import sessions
  from tests.factories import TalkSpeakerFactory
  from tests.common_tools import get_default_conference, make_user
  
  pytestmark = [pytest.mark.django_db]
  
  
  def test_speakers_templatetag():
      names = [
          # these 2 should not be listed
          ("To Be", "Announced"),
          ("Tobey", "Announced"),
          # these 2 should be groupped under D
          ("Dan", "Schmoe"),
          ("Đan", "Again"),
          # these 2 should be groupped under A
          ("Anna", "Doe"),
          ("Ändy", "Unicode"),
          # Make sure we preserve unicode for non-latin names.
          # the numbers are here to work around quirks of how the atendeeprofile slugs are generated by the factory
          ("艾", "未未1"),
          ("Никола", "Тесла2"),
      ]
      conf = get_default_conference()
      speakers = [
          TalkSpeakerFactory(
              speaker__user=make_user(first_name=f_name, last_name=l_name),
              talk__status='accepted',
          )
          for (i, (f_name, l_name)) in enumerate(names)
      ]
      data = sessions.speakers(conf.code)
      assert set(data['groups'].keys()) == {
          'A',
          'D',
          '艾',
          'Н',  # this is not an H it's https://en.wikipedia.org/wiki/En_(Cyrillic)
      }
      assert [s['fullname'] for s in data['groups']['D']] == ["Đan Again", "Dan Schmoe"]
      assert [s['fullname'] for s in data['groups']['A']] == ["Ändy Unicode", "Anna Doe"]
      assert [s['fullname'] for s in data['groups']['艾']] == ["艾 未未1"]
      assert [s['fullname'] for s in data['groups']['Н']] == ["Никола Тесла2"]
  
subject: fix typo in test_p3_templatetags test name (#1277)