FAQ | This is a LIVE service | Changelog

Make account factories more realistic

Description

This ticket is to change the AccountFactory and AccountDetailFactory to generate more realistic data.

Further details

Currently the last name on the Account instance is very likely to not be the same last name as the full name in the attached AccountDetail instance when generated through AccountDetailFactory. Also, the code is a combination of lowercase and uppercase characters and numbers, which might distract the user who's testing the application from what we want to test.

Example codes:

  • Staff code is 3 lowercase letters, 3 digits, 1 lowercase letter and 2 digits (e.g. bax238i78)
  • Postgraduate USN is a 9 digit number beginning with a 3
  • PGCE codes are 7 digit numbers
  • Undergraduates have an UCAS ID which is a 10 digit number

Task list

  • Using the examples given above, come up with (factory) code that closely matches the examples codes (but doesn't necessarily have to match them exactly)
  • Change the AccountDetailFactory to look at the last_name from the associated account and use that for the generation of the full name

Acceptance criteria

When generating accounts through the factories:

  • Last name from Account and last name in the full name of AccountDetail to match
  • Code closely matches the examples codes
    • Factory randomly decides "scheme" from examples above then generates code matching.

Links/references

Edited by Mike Knee