def node(self, node_license, user): node = ProjectFactory(creator=user) node.node_license = NodeLicenseRecordFactory( node_license=node_license, year=self.YEAR, copyright_holders=self.COPYRIGHT_HOLDERS) node.save() return node
def setUp(self): super(TestNodeLicenses, self).setUp() self.user = AuthUserFactory() self.node = ProjectFactory(creator=self.user) self.LICENSE_NAME = 'MIT License' self.node_license = NodeLicense.objects.get(name=self.LICENSE_NAME) self.YEAR = '2105' self.COPYRIGHT_HOLDERS = ['Foo', 'Bar'] self.node.node_license = NodeLicenseRecordFactory( node_license=self.node_license, year=self.YEAR, copyright_holders=self.COPYRIGHT_HOLDERS) self.node.save()
def test_loading_by_object_id(self): obj = NodeLicenseRecordFactory() assert NodeLicenseRecord.load(obj._id) == obj
def test_long_id_gets_generated_on_creation(self): obj = NodeLicenseRecordFactory() assert obj._id assert len(obj._id) > 5