Merge branch 'hotfix/featureflag-remove-migration' into relcorp

relcorp
Anthony Johnson 2018-10-24 12:04:27 -06:00
commit 2a35a26f0d
No known key found for this signature in database
GPG Key ID: 709FE91423F05AA0
2 changed files with 5 additions and 37 deletions

View File

@ -1,35 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-24 07:43
from __future__ import unicode_literals
from django.db import migrations
FEATURE_ID = 'mkdocs_theme_rtd'
def forward_add_feature(apps, schema_editor):
Feature = apps.get_model('projects', 'Feature')
Feature.objects.create(
feature_id=FEATURE_ID,
# Not using ``default_true=True`` because we will do this manually in
# the database from the Corporate site only, since this is not required
# in the Community site
# default_true=True,
)
def reverse_add_feature(apps, schema_editor):
Feature = apps.get_model('projects', 'Feature')
Feature.objects.filter(feature_id=FEATURE_ID).delete()
class Migration(migrations.Migration):
dependencies = [
('projects', '0027_remove_json_with_html_feature'),
]
operations = [
migrations.RunPython(forward_add_feature, reverse_add_feature),
]

View File

@ -229,9 +229,12 @@ class MkdocsBuilderTest(TestCase):
def test_get_theme_name_with_feature_flag(self, checkout_path, run):
tmpdir = tempfile.mkdtemp()
checkout_path.return_value = tmpdir
Feature.objects.get(
feature = get(
Feature,
feature_id=Feature.MKDOCS_THEME_RTD,
).projects.add(self.project)
)
feature.projects.add(self.project)
python_env = Virtualenv(
version=self.version,