Details

    • Type: Sub-task Sub-task
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Current Version
    • Fix Version/s: None
    • Component/s: OIOIOI
    • Labels:

      Description

      Example error:

      ______________ TestOpenParticipantsRegistration.test_contest_info ______________

      self = <oioioi.participants.tests.TestOpenParticipantsRegistration testMethod=test_contest_info>

          def test_contest_info(self):
              contest = Contest.objects.get()
              user = User.objects.get(username='test_user')
              p = Participant(contest=contest, user=user)
              p.save()
      > OpenRegistration(participant_id=p.id, **self.reg_data).save()

      oioioi/participants/tests.py:252:
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
      ../virtualenv/lib/python2.7/site-packages/django/db/models/base.py:796: in save
          force_update=force_update, update_fields=update_fields)
      ../virtualenv/lib/python2.7/site-packages/django/db/models/base.py:824: in save_base
          updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
      ../virtualenv/lib/python2.7/site-packages/django/db/models/base.py:908: in _save_table
          result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
      ../virtualenv/lib/python2.7/site-packages/django/db/models/base.py:947: in _do_insert
          using=using, raw=raw)
      ../virtualenv/lib/python2.7/site-packages/django/db/models/manager.py:85: in manager_method
          return getattr(self.get_queryset(), name)(*args, **kwargs)
      ../virtualenv/lib/python2.7/site-packages/django/db/models/query.py:1045: in _insert
          return query.get_compiler(using=using).execute_sql(return_id)
      ../virtualenv/lib/python2.7/site-packages/django/db/models/sql/compiler.py:1053: in execute_sql
          for sql, params in self.as_sql():
      ../virtualenv/lib/python2.7/site-packages/django/db/models/sql/compiler.py:1006: in as_sql
          for obj in self.query.objs
      ../virtualenv/lib/python2.7/site-packages/django/db/models/sql/compiler.py:945: in prepare_value
          value = field.get_db_prep_save(value, connection=self.connection)
      ../virtualenv/lib/python2.7/site-packages/django/db/models/fields/__init__.py:755: in get_db_prep_save
          prepared=False)
      ../virtualenv/lib/python2.7/site-packages/django/db/models/fields/__init__.py:747: in get_db_prep_value
          value = self.get_prep_value(value)
      ../virtualenv/lib/python2.7/site-packages/django/db/models/fields/__init__.py:1025: in get_prep_value
          return self.to_python(value)
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

      self = <django.db.models.fields.BooleanField: terms_accepted>, value = 'y'

          def to_python(self, value):
              if value in (True, False):
                  # if value is 1 or 0 than it's equal to True or False, but we want
                  # to return a true bool for semantic reasons.
                  return bool(value)
              if value in ('t', 'True', '1'):
                  return True
              if value in ('f', 'False', '0'):
                  return False
              raise exceptions.ValidationError(
                  self.error_messages['invalid'],
                  code='invalid',
      > params={'value': value},
              )
      E ValidationError: [u"'y' value must be either True or False."]

      ../virtualenv/lib/python2.7/site-packages/django/db/models/fields/__init__.py:1018: ValidationError

        Activity

        Michał Sidor made changes -
        Field Original Value New Value
        Assignee Michał Sidor [ michcioperz ]
        Michał Sidor made changes -
        Status New [ 10000 ] Open [ 1 ]
        Michał Sidor made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Michał Sidor [ michcioperz ] Szymon Acedański [ accek ]
        Resolution Fixed [ 1 ]
        Szymon Acedański made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Szymon Acedański
            Reporter:
            Artur Puzio
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: