mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-14 07:18:45 +00:00
Rename lookupAttribs and nonLookupAttribs + add slug to Person
This commit is contained in:
@@ -39,13 +39,13 @@ class ImportTest(TestCase):
|
||||
def setUpTestData(cls):
|
||||
def make_person(firstname, lastname, nickname=False, vfho=False, guest=False):
|
||||
fullname = f"{firstname} {lastname}"
|
||||
lookupAttribs = {"first_name": firstname, "last_name": (lastname or "")}
|
||||
nonLookupAttribs = {"is_vfho": vfho, "fullname": fullname, "nickname": nickname}
|
||||
person = Person.objects.create(**nonLookupAttribs, **lookupAttribs)
|
||||
coUniqueAttribs = {"first_name": firstname, "last_name": (lastname or "")}
|
||||
otherAttribs = {"is_vfho": vfho, "fullname": fullname, "nickname": nickname}
|
||||
person = Person.objects.create(**otherAttribs, **coUniqueAttribs)
|
||||
|
||||
lookupAttribs = {"person": person, "expedition": cls.test_expo}
|
||||
nonLookupAttribs = {"is_guest": guest}
|
||||
pe = PersonExpedition.objects.create(**nonLookupAttribs, **lookupAttribs)
|
||||
coUniqueAttribs = {"person": person, "expedition": cls.test_expo}
|
||||
otherAttribs = {"is_guest": guest}
|
||||
pe = PersonExpedition.objects.create(**otherAttribs, **coUniqueAttribs)
|
||||
|
||||
return person
|
||||
|
||||
@@ -58,9 +58,9 @@ class ImportTest(TestCase):
|
||||
if frontmatter_file.is_file():
|
||||
frontmatter_file.unlink() # delete if it exists
|
||||
|
||||
lookupAttribs = {"year": TEST_YEAR}
|
||||
nonLookupAttribs = {"name": f"CUCC expo-test {TEST_YEAR}"}
|
||||
cls.test_expo = Expedition.objects.create(**nonLookupAttribs, **lookupAttribs)
|
||||
coUniqueAttribs = {"year": TEST_YEAR}
|
||||
otherAttribs = {"name": f"CUCC expo-test {TEST_YEAR}"}
|
||||
cls.test_expo = Expedition.objects.create(**otherAttribs, **coUniqueAttribs)
|
||||
|
||||
fred = make_person("Fred", "Smartarse", nickname="freddy")
|
||||
phil = make_person("Phil", "Tosser", nickname="tosspot")
|
||||
|
||||
Reference in New Issue
Block a user