Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Don't use autospec in mock_sheet
Browse files Browse the repository at this point in the history
1b5d844 fixed a typo, however only this
typo actually made mock_sheet work due to the intended
GenericResourceSheet spec not being used.

This now removes the autospec again -> FIXME - joka will have a look
sometime later.
  • Loading branch information
Nicolas Dietrich committed Jul 30, 2014
1 parent 1583dc5 commit 4359f22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/adhocracy/adhocracy/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ def node() -> colander.MappingSchema:
@fixture()
def mock_sheet() -> Mock:
"""Mock :class:`adhocracy.sheets.GenericResourceSheet`."""
from adhocracy.sheets import GenericResourceSheet
from adhocracy.interfaces import sheet_metadata
from adhocracy.interfaces import ISheet
sheet = Mock(spec=GenericResourceSheet)
# FIXME: Use spec=GenericResourceSheet for Mock; however this fails if the
# mock object is deepcopied.
sheet = Mock()
sheet.meta = sheet_metadata._replace(isheet=ISheet)
return sheet

Expand Down

0 comments on commit 4359f22

Please sign in to comment.