Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlamallama committed Feb 1, 2024
1 parent 56bd54c commit 432dfcb
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 25 deletions.
14 changes: 11 additions & 3 deletions home/export_content_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@
from wagtail.models import Locale, Page # type: ignore
from wagtail.query import PageQuerySet # type: ignore

from home.models import (ContentPage, ContentPageIndex, HomePage,
MessengerBlock, SMSBlock, USSDBlock, VariationBlock,
ViberBlock, WhatsappBlock)
from home.models import (
ContentPage,
ContentPageIndex,
HomePage,
MessengerBlock,
SMSBlock,
USSDBlock,
VariationBlock,
ViberBlock,
WhatsappBlock,
)

HP_CTYPE = HomePage._meta.verbose_name
CP_CTYPE = ContentPage._meta.verbose_name
Expand Down
15 changes: 12 additions & 3 deletions home/import_content_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,18 @@
from wagtail.models.sites import Site # type: ignore
from wagtail.rich_text import RichText # type: ignore

from home.models import (ContentPage, ContentPageIndex, ContentQuickReply,
ContentTrigger, HomePage, MessengerBlock, SMSBlock,
USSDBlock, ViberBlock, WhatsappBlock)
from home.models import (
ContentPage,
ContentPageIndex,
ContentQuickReply,
ContentTrigger,
HomePage,
MessengerBlock,
SMSBlock,
USSDBlock,
ViberBlock,
WhatsappBlock,
)

PageId = tuple[str, Locale]

Expand Down
3 changes: 1 addition & 2 deletions home/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
from taggit.models import ItemBase, TagBase, TaggedItemBase
from wagtail import blocks
from wagtail.api import APIField
from wagtail.blocks import (StreamBlockValidationError,
StructBlockValidationError)
from wagtail.blocks import StreamBlockValidationError, StructBlockValidationError
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
from wagtail.documents.blocks import DocumentChooserBlock
from wagtail.fields import StreamField
Expand Down
3 changes: 1 addition & 2 deletions home/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

from wagtail.models.sites import Site # type: ignore

from home.constants import (AGE_CHOICES, GENDER_CHOICES,
RELATIONSHIP_STATUS_CHOICES)
from home.constants import AGE_CHOICES, GENDER_CHOICES, RELATIONSHIP_STATUS_CHOICES
from home.models import SiteSettings

PFOption = tuple[str, list[str]]
Expand Down
14 changes: 11 additions & 3 deletions home/tests/page_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@
from wagtail.blocks import RichTextBlock, StructBlock # type: ignore
from wagtail.models import Page # type: ignore

from home.models import (ContentPage, ContentPageIndex, ContentQuickReply,
ContentTrigger, MessengerBlock, SMSBlock, USSDBlock,
ViberBlock, WhatsappBlock)
from home.models import (
ContentPage,
ContentPageIndex,
ContentQuickReply,
ContentTrigger,
MessengerBlock,
SMSBlock,
USSDBlock,
ViberBlock,
WhatsappBlock,
)

TPage = TypeVar("TPage", bound=Page)

Expand Down
24 changes: 19 additions & 5 deletions home/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,25 @@
from wagtail import blocks

from home.content_import_export import import_content
from home.models import (ContentPage, HomePage, OrderedContentSet, PageView,
VariationBlock)

from .page_builder import (MBlk, MBody, PageBuilder, SBlk, SBody, UBlk, UBody,
WABlk, WABody)
from home.models import (
ContentPage,
HomePage,
OrderedContentSet,
PageView,
VariationBlock,
)

from .page_builder import (
MBlk,
MBody,
PageBuilder,
SBlk,
SBody,
UBlk,
UBody,
WABlk,
WABody,
)
from .utils import create_page


Expand Down
19 changes: 16 additions & 3 deletions home/tests/test_content_import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,22 @@
from home.models import ContentPage, ContentPageIndex, HomePage

from .helpers import set_profile_field_options
from .page_builder import (MBlk, MBody, NextBtn, PageBtn, PageBuilder, SBlk,
SBody, UBlk, UBody, VarMsg, VBlk, VBody, WABlk,
WABody)
from .page_builder import (
MBlk,
MBody,
NextBtn,
PageBtn,
PageBuilder,
SBlk,
SBody,
UBlk,
UBody,
VarMsg,
VBlk,
VBody,
WABlk,
WABody,
)

ExpDict = dict[str, Any]
ExpPair = tuple[ExpDict, ExpDict]
Expand Down
11 changes: 9 additions & 2 deletions home/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
from wagtail.blocks import StructBlockValidationError
from wagtail.images import get_image_model

from home.models import (GoToPageButton, HomePage, NextMessageButton, PageView,
SMSBlock, USSDBlock, WhatsappBlock)
from home.models import (
GoToPageButton,
HomePage,
NextMessageButton,
PageView,
SMSBlock,
USSDBlock,
WhatsappBlock,
)

from .page_builder import PageBuilder, WABlk, WABody
from .utils import create_page, create_page_rating
Expand Down
14 changes: 12 additions & 2 deletions home/tests/test_page_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,18 @@
from home.models import ContentPage, ContentPageIndex, HomePage

from .helpers import set_profile_field_options
from .page_builder import (MBlk, MBody, NextBtn, PageBtn, PageBuilder, VarMsg,
VBlk, VBody, WABlk, WABody)
from .page_builder import (
MBlk,
MBody,
NextBtn,
PageBtn,
PageBuilder,
VarMsg,
VBlk,
VBody,
WABlk,
WABody,
)


def unwagtail(val): # type: ignore[no-untyped-def] # No type info
Expand Down

0 comments on commit 432dfcb

Please sign in to comment.