Ejemplo n.º 1
0
    def testRecordNameFromEquivIdentifier(self):
        no_signals()
        record = Record.objects.create()
        rid = record.id
        self.assertTrue(record.id)
        fv = FieldValue.objects.create(field=self.idfield,
                                       record=record,
                                       value='Identifier 407')

        record = Record.objects.get(id=rid)
        self.assertEqual('identifier-407', record.name)

        # setting field value again should not change name
        fv.save()

        record = Record.objects.get(id=rid)
        self.assertEqual('identifier-407', record.name)

        # make sure setting another field value does not change the id

        FieldValue.objects.create(field=standardfield('title'),
                                  record=record,
                                  value='Some title')

        record = Record.objects.get(id=rid)
        self.assertEqual('identifier-407', record.name)
Ejemplo n.º 2
0
    def test_record_name_from_equiv_identifier(self):
        record = Record.objects.create()
        rid = record.id
        self.assertTrue(record.id)
        fv = FieldValue.objects.create(field=self.idfield,
                                       record=record,
                                       value='Identifier 407')

        record = Record.objects.get(id=rid)
        self.assertEqual('identifier-407', record.name)

        # setting field value again should not change name
        fv.save()

        record = Record.objects.get(id=rid)
        self.assertEqual('identifier-407', record.name)

        # make sure setting another field value does not change the id

        FieldValue.objects.create(field=standardfield('title'),
                                  record=record,
                                  value='Some title')

        record = Record.objects.get(id=rid)
        self.assertEqual('identifier-407', record.name)
Ejemplo n.º 3
0
 def setUp(self):
     no_signals()
     self.collection = Collection.objects.create(title='Test Collection', name='test')
     self.dcid = standardfield('identifier')
     self.idfield = Field.objects.create(label='My Identifier')
     self.idfield.equivalent.add(self.dcid)
Ejemplo n.º 4
0
 def setUp(self):
     self.dcid = standardfield('identifier')
     self.dcrelation = standardfield('relation')
Ejemplo n.º 5
0
 def setUp(self):
     self.collection = Collection.objects.create(
         title='Test Collection', name='test')
     self.dcid = standardfield('identifier')
     self.idfield = Field.objects.create(label='My Identifier')
     self.idfield.equivalent.add(self.dcid)