Re-factor the ORM tests to use randomized fake data
- create `*Factory` classes with fakerboy and faker that generate randomized instances of the ORM models - add new pytest marker: "db" are the integration tests involving the database whereas "e2e" will be all other integration tests - streamline the docstrings in the ORM models
This commit is contained in:
parent
416a58f9dc
commit
78dba23d5d
19 changed files with 1092 additions and 721 deletions
|
|
@ -1,4 +1,4 @@
|
|||
"""Provide the ORM's Address model."""
|
||||
"""Provide the ORM's `Address` model."""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import orm
|
||||
|
|
@ -9,7 +9,7 @@ from urban_meal_delivery.db import meta
|
|||
|
||||
|
||||
class Address(meta.Base):
|
||||
"""An Address of a Customer or a Restaurant on the UDP."""
|
||||
"""An address of a `Customer` or a `Restaurant` on the UDP."""
|
||||
|
||||
__tablename__ = 'addresses'
|
||||
|
||||
|
|
@ -72,11 +72,11 @@ class Address(meta.Base):
|
|||
|
||||
@hybrid.hybrid_property
|
||||
def is_primary(self) -> bool:
|
||||
"""If an Address object is the earliest one entered at its location.
|
||||
"""If an `Address` object is the earliest one entered at its location.
|
||||
|
||||
Street addresses may have been entered several times with different
|
||||
versions/spellings of the street name and/or different floors.
|
||||
|
||||
`is_primary` indicates the first in a group of addresses.
|
||||
`.is_primary` indicates the first in a group of `Address` objects.
|
||||
"""
|
||||
return self.id == self._primary_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue