Fixing test by using six.assertCountEqual (#22219)

* using six.assertCountEqual

* Fix type mismatches in css migrations
This commit is contained in:
Manjinder Singh
2019-11-04 09:29:32 -05:00
committed by GitHub
parent 918209137a
commit cb186d94d3
4 changed files with 6 additions and 6 deletions

View File

@@ -2507,8 +2507,8 @@ class ProblemBlockXMLTest(unittest.TestCase):
name = "Other Test Capa Problem"
descriptor = self._create_descriptor(xml, name=name)
self.assertEqual(descriptor.problem_types, {"multiplechoiceresponse", "optionresponse"})
self.assertEqual(
descriptor.index_dictionary(), {
six.assertCountEqual(
self, descriptor.index_dictionary(), {
'content_type': ProblemBlock.INDEX_CONTENT_TYPE,
'problem_types': ["optionresponse", "multiplechoiceresponse"],
'content': {

View File

@@ -19,7 +19,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('location', UsageKeyField(max_length=255, db_index=True)),
('field', models.CharField(max_length=255)),
('value', models.TextField(default=b'null')),
('value', models.TextField(default=u'null')),
],
),
migrations.CreateModel(

View File

@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='customcourseforedx',
name='structure_json',
field=models.TextField(null=True, verbose_name=b'Structure JSON', blank=True),
field=models.TextField(null=True, verbose_name=u'Structure JSON', blank=True),
),
]

View File

@@ -32,7 +32,7 @@ class CustomCourseForEdX(models.Model):
coach = models.ForeignKey(User, db_index=True, on_delete=models.CASCADE)
# if not empty, this field contains a json serialized list of
# the master course modules
structure_json = models.TextField(verbose_name='Structure JSON', blank=True, null=True)
structure_json = models.TextField(verbose_name=u'Structure JSON', blank=True, null=True)
class Meta(object):
app_label = 'ccx'
@@ -120,4 +120,4 @@ class CcxFieldOverride(models.Model):
app_label = 'ccx'
unique_together = (('ccx', 'location', 'field'),)
value = models.TextField(default='null')
value = models.TextField(default=u'null')