Skip to content

Commit

Permalink
Make tests pass (#6872)
Browse files Browse the repository at this point in the history
* Flake8

* Sitemap.xml test fix
  • Loading branch information
KalobTaulien authored and Pomax committed Jul 27, 2021
1 parent 7a65008 commit 9124143
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions network-api/networkapi/campaign/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import json
from networkapi.wagtailpages.models import Petition, Signup


def process_lang_code(lang):
# Salesforce expects "pt" instead of "pt-BR".
# See https://github.com/mozilla/foundation.mozilla.org/issues/5993
Expand Down
6 changes: 5 additions & 1 deletion network-api/networkapi/wagtailpages/pagemodels/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ class ParticipatePage2(PrimaryPage):
class Styleguide(PrimaryPage):
template = 'wagtailpages/static/styleguide.html'


class HomepageSpotlightPosts(TranslatableMixin, WagtailOrderable):
page = ParentalKey(
'wagtailpages.Homepage',
Expand Down Expand Up @@ -453,7 +454,7 @@ class Meta(TranslatableMixin.Meta):
def __str__(self):
return self.page.title + '->' + self.highlight.title

# from wagtail.core.models import BootstrapTranslatableModel

class CTA4(TranslatableMixin, CTABase):
page = ParentalKey(
'wagtailpages.ParticipatePage2',
Expand Down Expand Up @@ -492,11 +493,14 @@ class ParticipateHighlights(ParticipateHighlightsBase):

class Meta(TranslatableMixin.Meta):
pass


class ParticipateHighlights2(ParticipateHighlightsBase):
page = ParentalKey(
'wagtailpages.ParticipatePage2',
related_name='featured_highlights2',
)

class Meta(TranslatableMixin.Meta):
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.db import models

from wagtail.admin.edit_handlers import FieldPanel, InlinePanel, StreamFieldPanel
from wagtail.core.models import TranslatableMixin, TranslatableMixin, Page
from wagtail.core.models import TranslatableMixin, Page
from wagtail.core.fields import RichTextField
from wagtail.snippets.edit_handlers import SnippetChooserPanel
from wagtail.snippets.models import register_snippet
Expand Down
2 changes: 1 addition & 1 deletion network-api/networkapi/wagtailpages/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def test_buyersguide_product_redirect_route(self):
self.assertEqual(response.redirect_chain[0][0], product.url)

def test_sitemap_entries(self):
response = self.client.get('/sitemap.xml')
response = self.client.get('/en/sitemap.xml')
context = response.context

self.assertEqual(context.template_name, 'sitemap.xml')
Expand Down

0 comments on commit 9124143

Please sign in to comment.