Пример #1
0
 def test_license_uniqueness_on_id_is_enforced_in_the_database(self):
     # Using MongoDB's uniqueness instead of modular-odm's allows us to
     # kludge a race-less upsert in ensure_licenses.
     NodeLicense(id='foo', name='bar', text='baz').save()
     assert_raises(KeyExistsException,
                   NodeLicense(id='foo', name='buz', text='boo').save)
Пример #2
0
 def test_license_uniqueness_on_id_is_enforced_in_the_database(self):
     NodeLicense(license_id='foo', name='bar', text='baz').save()
     assert_raises(
         ValidationError,
         NodeLicense(license_id='foo', name='buz', text='boo').save)