コード例 #1
0
ファイル: tests.py プロジェクト: riqharris1/CI_Stream3Project
    def setUp(self):
        super(UUIDPrimaryKeyModelTests, self).setUp()

        # Multiple objects are generated in order to test the auto-generation and
        # uniqueness features of the UUID field.
        for i in range(0, INSTANCE_COUNT):
            obj = UUIDPrimaryKeyModel()
            obj.save()
コード例 #2
0
ファイル: tests.py プロジェクト: monetizeio/django-patterns
  def setUp(self):
    super(UUIDPrimaryKeyModelTests, self).setUp()

    # Multiple objects are generated in order to test the auto-generation and
    # uniqueness features of the UUID field.
    for i in range(0, INSTANCE_COUNT):
      obj = UUIDPrimaryKeyModel()
      obj.save()
コード例 #3
0
ファイル: tests.py プロジェクト: riqharris1/CI_Stream3Project
 def test_uuid_is_unique(self):
     """Tests that two UUIDPrimaryKeyModel objects cannot be created with the
 same UUID value."""
     obj = UUIDPrimaryKeyModel.objects.filter()[0]
     new_obj = UUIDPrimaryKeyModel()
     new_obj.id = obj.id
     self.assertRaisesRegexp(
         django.core.exceptions.ValidationError,
         u'with this Universally unique identifier already exists',
         new_obj.validate_unique,
     )
コード例 #4
0
ファイル: tests.py プロジェクト: monetizeio/django-patterns
 def test_uuid_is_unique(self):
   """Tests that two UUIDPrimaryKeyModel objects cannot be created with the
   same UUID value."""
   obj = UUIDPrimaryKeyModel.objects.filter()[0]
   new_obj = UUIDPrimaryKeyModel()
   new_obj.id = obj.id
   self.assertRaisesRegexp(
     django.core.exceptions.ValidationError,
     u'with this Universally unique identifier already exists',
     new_obj.validate_unique,
   )