Bumped version to 0.0.5
Fixed problem where fields contained shared values by performing a shallow copy on all fields during Record instantiation. That way, each record has its own copy of the field instances, rather than the shared class-wide instance provided by the definition.
This commit is contained in:
parent
4023d46b4a
commit
7cb8bed61e
4 changed files with 28 additions and 23 deletions
|
@ -1,6 +1,6 @@
|
|||
from record import *
|
||||
|
||||
VERSION = (0, 0, 3)
|
||||
VERSION = (0, 0, 5)
|
||||
|
||||
RECORD_TYPES = [
|
||||
'SubmitterRecord',
|
||||
|
@ -146,3 +146,16 @@ def verify_records(records):
|
|||
verify_required_records(records)
|
||||
verify_record_order(records)
|
||||
|
||||
def test_unique_fields():
|
||||
r1 = EmployeeWageRecord()
|
||||
|
||||
r1.employee_first_name.value = "John Johnson"
|
||||
|
||||
r2 = EmployeeWageRecord()
|
||||
print 'r1:', r1.employee_first_name.value, r1.employee_first_name, r1.employee_first_name.creation_counter
|
||||
print 'r2:', r2.employee_first_name.value, r2.employee_first_name, r2.employee_first_name.creation_counter
|
||||
|
||||
if r1.employee_first_name.value == r2.employee_first_name.value:
|
||||
raise ValidationError("Horrible problem involving shared values across records")
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue