#27951: Failure in Oracle test
-------------------------------------------+------------------------
               Reporter:  Shai Berger      |          Owner:  nobody
                   Type:  Bug              |         Status:  new
              Component:  Uncategorized    |        Version:  1.11
               Severity:  Release blocker  |       Keywords:  test
           Triage Stage:  Unreviewed       |      Has patch:  0
    Needs documentation:  0                |    Needs tests:  0
Patch needs improvement:  0                |  Easy pickings:  0
                  UI/UX:  0                |
-------------------------------------------+------------------------
 This from our CI:
 {{{
 ======================================================================
 FAIL [0.018s]: test_to_field_name_with_initial_data
 (model_forms.tests.ModelMultipleChoiceFieldTests)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "<https://djangoci.com/job/django-
 
oracle-1.11/database=oracle12,label=trusty,python=python2.7/ws/tests/model_forms/tests.py",>
 line 1974, in test_to_field_name_with_initial_data
     self.assertEqual(form['categories'].value(), [self.c2.slug,
 self.c3.slug])
 AssertionError: Lists differ: [u'third-test', u'its-test'] != [u'its-
 test', u'third-test']

 First differing element 0:
 u'third-test'
 u'its-test'

 - [u'third-test', u'its-test']
 + [u'its-test', u'third-test']

 ----------------------------------------------------------------------
 }}}

 The relevant code in {{{stable/1.11.x}}} is:
 {{{
     def test_to_field_name_with_initial_data(self):
         class ArticleCategoriesForm(forms.ModelForm):
             categories =
 forms.ModelMultipleChoiceField(Category.objects.all(),
 to_field_name='slug')

             class Meta:
                 model = Article
                 fields = ['categories']

         article = Article.objects.create(
             headline='Test article',
             slug='test-article',
             pub_date=datetime.date(1988, 1, 4),
             writer=Writer.objects.create(name='Test writer'),
             article='Hello.',
         )
         article.categories.add(self.c2, self.c3)
         form = ArticleCategoriesForm(instance=article)
         self.assertEqual(form['categories'].value(), [self.c2.slug,
 self.c3.slug])
 }}}

 In master it's the same except that the {{{assertEqual}}} in the end is
 replaced with {{{assertCountEqual}}} which ignore the order of items. I
 propose that we backport this change (ticket opened really mostly because
 we're in code freeze).

--
Ticket URL: <https://code.djangoproject.com/ticket/27951>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.5a9cd0fcdca07bd95248f828093e34d3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to