Skip to content

Commit

Permalink
feat(templates): Enhance I'm Now Following [#332]
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCleric committed May 1, 2024
1 parent 4c629d2 commit 291e427
Show file tree
Hide file tree
Showing 10 changed files with 1,013 additions and 228 deletions.
6 changes: 6 additions & 0 deletions bc/channel/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ class Meta:
group = SubFactory(GroupFactory)

class Params:
bluesky = factory.Trait(
service=Channel.BLUESKY,
account="BigCases2-faux.bsky.social",
account_id="Bigsky-big-cases-email-faux",
enabled=True,
)
mastodon = factory.Trait(
service=Channel.MASTODON,
account="BigCases2-faux",
Expand Down
18 changes: 10 additions & 8 deletions bc/core/tests/test_make_dev_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
# MagicMocks, so those lines are commented to ignore the [attr-defined]
# error.
import re
from typing import cast
from unittest.mock import ANY, MagicMock, call, patch

from django.test import SimpleTestCase

from bc.core.management.commands.make_dev_data import MakeDevData
from bc.subscription.tests.factories import SubscriptionFactory
from bc.subscription.utils.courtlistener import DocketDict

CL_DOCKET_RESULT = {
"docket_id": 42,
CL_DOCKET_RESULT: DocketDict = {
"id": 42,
"docket_number": "US 12345",
"case_name": "US v Bobolink",
"court_id": 5,
"pacer_case_id": 89,
"court_id": "5",
"pacer_case_id": "89",
"slug": "cl_slug_for_docket",
}

Expand All @@ -43,7 +45,7 @@ def test_default_values(self) -> None:
return_value=([], "subbed randoms"),
)
class TestCreate(SimpleTestCase):
cl_docket_result: dict[str, object] = {}
cl_docket_result = cast(DocketDict, {})
mock_big_cases_group: MagicMock = MagicMock()
mocked_make_big_cases_group_and_channels: MagicMock = MagicMock()
mocked_make_little_cases_group_and_channels: MagicMock = MagicMock()
Expand Down Expand Up @@ -404,7 +406,7 @@ def has_group_subscribed_str(
# @see https://docs.python.org/3/library/unittest.mock.html#where-to-patch
@patch("bc.core.management.commands.make_dev_data.lookup_docket_by_cl_id")
class TestMakeSubsFromClDocketId(NumSubdToGroupStrTest, SimpleTestCase):
cl_docket_result: dict[str, object] = {}
cl_docket_result: DocketDict = cast(DocketDict, {})
mocked_channels: MagicMock = MagicMock()
mock_big_cases_group: MagicMock = MagicMock()

Expand Down Expand Up @@ -447,8 +449,8 @@ def test_creates_subs_from_factory(
cl_docket_id=67890,
docket_number="US 12345",
docket_name="US v Bobolink",
cl_court_id=5,
pacer_case_id=89,
cl_court_id="5",
pacer_case_id="89",
cl_slug="cl_slug_for_docket",
channels=self.mock_big_cases_group.channels.all(),
)
Expand Down
Loading

0 comments on commit 291e427

Please sign in to comment.