old_contents: import pytest
  import datetime
  import virtool.web.dispatcher
  
  
  @pytest.fixture
  def static_time(monkeypatch):
      time = datetime.datetime(2017, 10, 6, 20, 0, 0, tzinfo=datetime.timezone.utc)
  
      monkeypatch.setattr("virtool.utils.timestamp", lambda: time)
  
      return time
  
  
  @pytest.fixture
  def test_dispatch(mocker, monkeypatch):
      m = mocker.Mock(spec=virtool.web.dispatcher.Dispatcher())
  
      mock_class = mocker.Mock()
      mock_class.return_value = m
  
      monkeypatch.setattr("virtool.web.dispatcher.Dispatcher", mock_class)
  
      return m.dispatch
  
new_contents: import pytest
  import datetime
  import virtool.web.dispatcher
  
  
  @pytest.fixture
  def test_random_alphanumeric(monkeypatch):
      class RandomAlphanumericTester:
  
          def __init__(self):
              self.choices = [
                  "aB67nm89jL56hj34AL90",
                  "fX1l90Rt45JK34bA7890",
                  "kl84Fg067jJa109lmQ021"
              ]
  
              self.last_choice = None
  
          def __call__(self, length=6, mixed_case=False, excluded=None):
              string = self.choices.pop()[:length]
  
              if not mixed_case:
                  string = string.lower()
  
              if string in excluded:
                  string = self.__call__(length, mixed_case, excluded)
  
              self.last_choice = string
  
              return string
  
          @property
          def next_choice(self):
              return self.choices[-1]
  
      tester = RandomAlphanumericTester()
  
      monkeypatch.setattr("virtool.utils.random_alphanumeric", tester)
  
      return tester
  
  
  @pytest.fixture
  def static_time(monkeypatch):
      time = datetime.datetime(2017, 10, 6, 20, 0, 0, tzinfo=datetime.timezone.utc)
  
      monkeypatch.setattr("virtool.utils.timestamp", lambda: time)
  
      return time
  
  
  @pytest.fixture
  def test_dispatch(mocker, monkeypatch):
      m = mocker.Mock(spec=virtool.web.dispatcher.Dispatcher())
  
      mock_class = mocker.Mock()
      mock_class.return_value = m
  
      monkeypatch.setattr("virtool.web.dispatcher.Dispatcher", mock_class)
  
      return m.dispatch
  
subject: Add random_alphanumeric fixture