def test_not_allowed_creation(self): package = PackageFactory.create() VersionFactory.create(package=package) with self.assertRaises((IntegrityError, ValidationError)): VersionFactory.create(package=package)
def test_creation(self): package = PackageFactory.build() version = VersionFactory.build(package=package) self.assertEqual(version.package, package)