Yeah, I've been trying to use the xblock functions but this one does cause
a little confusion when writing tests.


On Wed, Mar 26, 2014 at 3:13 PM, David Ormsbee <notifications@github.com>wrote:

> In apps/openassessment/xblock/test/test_peer.py:
>
> > @@ -142,3 +142,83 @@ def test_missing_keys_in_request(self, xblock):
> >              del assessment[missing]
> >              resp = self.request(xblock, 'peer_assess', json.dumps(assessment), response_format='json')
> >              self.assertEqual(resp['success'], False)
> > +
> > +    @scenario('data/over_grade_scenario.xml', user_id='Bob')
> > +    def test_turbo_grading(self, xblock):
> > +        student_item = xblock.get_student_item_dict()
> > +
> > +        sally_student_item = copy.deepcopy(student_item)
> > +        sally_student_item['student_id'] = "Sally"
> > +        sally_submission = xblock.create_submission(sally_student_item, u"Sally's answer")
> > +
> > +        # Hal comes and submits a response.
> > +        hal_student_item = copy.deepcopy(student_item)
> > +        hal_student_item['student_id'] = "Hal"
> > +        hal_submission = xblock.create_submission(hal_student_item, u"Hal's answer")
>
> As a reminder, using xblock's create_submission() has the side effect of
> setting that xblock's submission_uuid attribute to whatever was
> submitted, which is what it uses for later queries. I don't think it bites
> you here, but it's given me a headscratcher in the past.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/edx/edx-ora2/pull/191/files#r10993462>
> .
>