def test_creates_version(self, change_ids): p = Person(given_name='John', family_name='Doe', change_id=change_ids.get()) p.save() p.refresh_from_db() assert isinstance(p.version, Person.VersionModel)
def test_many_versions(self, change_ids): p = Person(given_name='John', family_name='Doe', change_id=change_ids.get()) p.save() names = ['Jane', 'John', 'Jone', 'Jane', 'James', 'Joe', 'Jim', 'Jack', 'Jacklynn'] for name in names: p.given_name = name p.change_id = change_ids.get() p.save() p.refresh_from_db() assert p.versions.first() == p.version for i, name in enumerate(reversed(['John'] + names)): assert p.versions.all()[i].given_name == name
def test_creates_version(share_source, change_ids): p = Person(given_name='John', family_name='Doe', change_id=change_ids.get()) p.save() p.refresh_from_db() assert isinstance(p.version, Person.VersionModel)