Skip to content

Commit

Permalink
Merge PNI model changes into Main branch (#7653)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pomax committed Oct 21, 2021
1 parent 6a41e3a commit 8dd7893
Show file tree
Hide file tree
Showing 7 changed files with 288 additions and 143 deletions.
12 changes: 0 additions & 12 deletions network-api/networkapi/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,6 @@ def setUp(self):
ai_uses_personal_data='Yes',
ai_is_transparent='No',
ai_helptext='The AI is a black box and no one knows how it works',
email='test@example.org',
live_chat='http://example.org/chat',
phone_number='1-555-555-5555',
twitter='@TwitterHandle',
)
self.software_product_page = SoftwareProductPageFactory.create(
# page fields
Expand Down Expand Up @@ -353,10 +349,6 @@ def test_product_page_import_mappings(self):
self.assertEqual(mappings["Manages security help text"], "manage_vulnerabilities_helptext")
self.assertEqual(mappings["Has privacy policy"], "privacy_policy")
self.assertEqual(mappings["Privacy policy help text"], "privacy_policy_helptext")
self.assertEqual(mappings["Phone number"], "phone_number")
self.assertEqual(mappings["Live chat"], "live_chat")
self.assertEqual(mappings["Email address"], "email")
self.assertEqual(mappings["Twitter"], "twitter")

def test_general_product_page_import_mappings(self):
"""
Expand Down Expand Up @@ -433,10 +425,6 @@ def test_product_page_export_fields(self):
self.assertIn("Manages security help text", export_fields)
self.assertIn("Has privacy policy", export_fields)
self.assertIn("Privacy policy help text", export_fields)
self.assertIn("Phone number", export_fields)
self.assertIn("Live chat", export_fields)
self.assertIn("Email address", export_fields)
self.assertIn("Twitter", export_fields)

def test_general_page_export_fields(self):
export_fields = self.general_product_page.get_export_fields()
Expand Down
8 changes: 0 additions & 8 deletions network-api/networkapi/wagtailpages/factory/buyersguide.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,6 @@ class Meta:
ai_uses_personal_data = LazyFunction(get_extended_yes_no_value)
ai_is_transparent = LazyFunction(get_extended_yes_no_value)
ai_helptext = Faker('sentence')
email = Faker('email')
live_chat = Faker('url')
phone_number = Faker('phone_number')
twitter = '@TwitterHandle'


class SoftwareProductPageFactory(ProductPageFactory):
Expand Down Expand Up @@ -234,10 +230,6 @@ def create_general_product_visual_regression_product(seed, pni_homepage):
ai_uses_personal_data='Yes',
ai_is_transparent='No',
ai_helptext='The AI is a black box and no one knows how it works',
email='test@example.org',
live_chat='http://example.org/chat',
phone_number='1-555-555-5555',
twitter='@TwitterHandle',
)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Generated by Django 3.1.11 on 2021-10-20 22:30

from django.db import migrations, models
import django.db.models.deletion
import networkapi.wagtailpages.fields
import wagtail.core.fields


class Migration(migrations.Migration):

dependencies = [
('wagtailimages', '0023_add_choose_permissions'),
('wagtailpages', '0042_add_callpower_cta'),
]

operations = [
migrations.AlterModelOptions(
name='buyersguideproductcategory',
options={'ordering': ['sort_order', '-parent__name', 'name'], 'verbose_name': 'Buyers Guide Product Category', 'verbose_name_plural': 'Buyers Guide Product Categories'},
),
migrations.AlterModelOptions(
name='productupdates',
options={'ordering': ['sort_order'], 'verbose_name': 'Product Update'},
),
migrations.RemoveField(
model_name='buyersguideproductcategory',
name='og_image',
),
migrations.RemoveField(
model_name='productpage',
name='email',
),
migrations.RemoveField(
model_name='productpage',
name='live_chat',
),
migrations.RemoveField(
model_name='productpage',
name='phone_number',
),
migrations.RemoveField(
model_name='productpage',
name='twitter',
),
migrations.AddField(
model_name='buyersguideproductcategory',
name='parent',
field=models.ForeignKey(blank=True, help_text='Leave this blank for a top-level category, or pick another category to nest this under', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailpages.buyersguideproductcategory'),
),
migrations.AddField(
model_name='buyersguideproductcategory',
name='share_image',
field=models.ForeignKey(blank=True, help_text='Optional image that will apear when category page is shared.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='wagtailimages.image', verbose_name='Share Image'),
),
migrations.AddField(
model_name='generalproductpage',
name='ai_can_user_control',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(help_text='Does the user have control over the AI features?'),
),
migrations.AddField(
model_name='generalproductpage',
name='ai_can_user_control_helptext',
field=models.TextField(blank=True, help_text='Helptext that will appear in the can user control section.', max_length=5000),
),
migrations.AddField(
model_name='generalproductpage',
name='ai_is_transparent_helptext',
field=models.TextField(blank=True, help_text='Helptext that will appear in the AI is transparent section.', max_length=5000),
),
migrations.AddField(
model_name='generalproductpage',
name='ai_is_untrustworthy',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(help_text='Is the AI untrustworthy?'),
),
migrations.AddField(
model_name='generalproductpage',
name='ai_is_untrustworthy_ding',
field=models.BooleanField(default=False, help_text='Tick this box if the AI invades privacy or behaves unethically.'),
),
migrations.AddField(
model_name='generalproductpage',
name='ai_is_untrustworthy_helptext',
field=models.TextField(blank=True, help_text='Helptext that will appear in the AI is untrustworthy section.', max_length=5000),
),
migrations.AddField(
model_name='generalproductpage',
name='ai_what_can_it_do',
field=wagtail.core.fields.RichTextField(blank=True, help_text='What kind of decisions does this AI make about you or for you?'),
),
migrations.AddField(
model_name='productpage',
name='mozilla_says',
field=models.BooleanField(blank=True, help_text='Whether or not Mozilla would recommend this product. Will appear as a thumbs up/down/middle.', null=True),
),
migrations.AddField(
model_name='productpage',
name='time_researched',
field=models.PositiveIntegerField(default=0, help_text='How many hours were spent researching this product?'),
),
migrations.AddField(
model_name='productpage',
name='tips_to_protect_yourself',
field=wagtail.core.fields.RichTextField(blank=True),
),
migrations.AlterField(
model_name='productpage',
name='blurb',
field=wagtail.core.fields.RichTextField(blank=True, help_text='Description of the product', max_length=5000),
),
migrations.AlterField(
model_name='productpage',
name='worst_case',
field=wagtail.core.fields.RichTextField(blank=True, help_text="What's the worst thing that could happen by using this product?", max_length=5000),
),
]
Loading

0 comments on commit 8dd7893

Please sign in to comment.