import pytest

from components.social.youtube.factories import ChannelFactory
from components.social.youtube.models import Video
from components.social.youtube.tasks import (fetch_all_videos,
    fetch_latest_videos)

pytestmark = pytest.mark.django_db


def test_fetch_all_videos():
    channel = ChannelFactory(username='revyver')
    fetch_all_videos(channel)
    assert channel.videos.count() > 0
    for video in channel.videos.all():
        assert isinstance(video, Video)


def test_fetch_latest_videos():
    channel = ChannelFactory(username='revyver')
    fetch_latest_videos()
    assert channel.videos.count() > 0
    for video in channel.videos.all():
        assert isinstance(video, Video)

import pytest

from components.social.youtube.factories import ChannelFactory
from components.social.youtube.models import Video
from components.social.youtube.tasks import (fetch_all_videos,
    fetch_latest_videos)

pytestmark = pytest.mark.django_db


def test_fetch_all_videos():
    channel = ChannelFactory(username='iceymoon')
    fetch_all_videos(channel)
    assert channel.videos.count() > 0
    for video in channel.videos.all():
        assert isinstance(video, Video)


def test_fetch_latest_videos():
    channel = ChannelFactory(username='iceymoon')
    fetch_latest_videos()
    assert channel.videos.count() > 0
    for video in channel.videos.all():
        assert isinstance(video, Video)

Switch to Jen's channel to (hopefully) make these tests faster.
Switch to Jen's channel to (hopefully) make these tests faster.

  import pytest
  
  from components.social.youtube.factories import ChannelFactory
  from components.social.youtube.models import Video
  from components.social.youtube.tasks import (fetch_all_videos,
      fetch_latest_videos)
  
  pytestmark = pytest.mark.django_db
  
  
  def test_fetch_all_videos():
-     channel = ChannelFactory(username='revyver')
+     channel = ChannelFactory(username='iceymoon')
      fetch_all_videos(channel)
      assert channel.videos.count() > 0
      for video in channel.videos.all():
          assert isinstance(video, Video)
  
  
  def test_fetch_latest_videos():
-     channel = ChannelFactory(username='revyver')
+     channel = ChannelFactory(username='iceymoon')
      fetch_latest_videos()
      assert channel.videos.count() > 0
      for video in channel.videos.all():
          assert isinstance(video, Video)
  
Switch to Jen's channel to (hopefully) make these tests faster.
## Code Before:
import pytest

from components.social.youtube.factories import ChannelFactory
from components.social.youtube.models import Video
from components.social.youtube.tasks import (fetch_all_videos,
    fetch_latest_videos)

pytestmark = pytest.mark.django_db


def test_fetch_all_videos():
    channel = ChannelFactory(username='revyver')
    fetch_all_videos(channel)
    assert channel.videos.count() > 0
    for video in channel.videos.all():
        assert isinstance(video, Video)


def test_fetch_latest_videos():
    channel = ChannelFactory(username='revyver')
    fetch_latest_videos()
    assert channel.videos.count() > 0
    for video in channel.videos.all():
        assert isinstance(video, Video)

## Instruction:
Switch to Jen's channel to (hopefully) make these tests faster.
## Code After:
import pytest

from components.social.youtube.factories import ChannelFactory
from components.social.youtube.models import Video
from components.social.youtube.tasks import (fetch_all_videos,
    fetch_latest_videos)

pytestmark = pytest.mark.django_db


def test_fetch_all_videos():
    channel = ChannelFactory(username='iceymoon')
    fetch_all_videos(channel)
    assert channel.videos.count() > 0
    for video in channel.videos.all():
        assert isinstance(video, Video)


def test_fetch_latest_videos():
    channel = ChannelFactory(username='iceymoon')
    fetch_latest_videos()
    assert channel.videos.count() > 0
    for video in channel.videos.all():
        assert isinstance(video, Video)
