Fix tests

This commit is contained in:
Andrew Brookins 2021-08-31 13:31:14 -07:00
parent 7f0fb15f19
commit ce3204325f

View file

@ -56,14 +56,6 @@ class Member(BaseRedisModel):
def test_validates_required_fields(): def test_validates_required_fields():
address = Address(
address_line_1="1 Main St.",
city="Happy Town",
state="WY",
postal_code=11111,
country="USA"
)
# Raises ValidationError: last_name, address are required # Raises ValidationError: last_name, address are required
with pytest.raises(ValidationError): with pytest.raises(ValidationError):
Member( Member(
@ -141,6 +133,13 @@ def test_saves_with_relationships():
# Save many model instances to Redis # Save many model instances to Redis
@pytest.skip("Not implemented yet") @pytest.skip("Not implemented yet")
def test_saves_many(): def test_saves_many():
address = Address(
address_line_1="1 Main St.",
city="Happy Town",
state="WY",
postal_code=11111,
country="USA"
)
today = datetime.date.today() today = datetime.date.today()
members = [ members = [
Member( Member(
@ -163,6 +162,21 @@ def test_saves_many():
@pytest.skip("No implemented yet") @pytest.skip("No implemented yet")
def test_updates_a_model(): def test_updates_a_model():
address = Address(
address_line_1="1 Main St.",
city="Happy Town",
state="WY",
postal_code=11111,
country="USA"
)
member = Member(
first_name="Andrew",
last_name="Brookins",
email="a@example.com",
address=address,
join_date=today
)
# Update a model instance in Redis # Update a model instance in Redis
member.first_name = "Brian" member.first_name = "Brian"
member.last_name = "Sam-Bodden" member.last_name = "Sam-Bodden"