-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #879 from boxwise/update-history-table-during-ship…
…ment Update history table during shipment (box state)
- Loading branch information
Showing
4 changed files
with
212 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
import pytest | ||
from boxtribute_server.models.definitions.history import DbChangeHistory | ||
|
||
from .box import another_marked_for_shipment_box_data | ||
|
||
def default_history_data(): | ||
mock_history = {"id": 112, "changes": "Changes"} | ||
return mock_history | ||
|
||
def data(): | ||
return [ | ||
{ | ||
# corresponding box was added to a shipment | ||
"id": 1, | ||
"changes": "box_state_id", | ||
"from_int": 1, | ||
"to_int": 3, | ||
"record_id": another_marked_for_shipment_box_data()["id"], | ||
"table_name": "stock", | ||
}, | ||
{"id": 112, "changes": "Changes"}, | ||
] | ||
|
||
@pytest.fixture() | ||
|
||
@pytest.fixture | ||
def default_history(): | ||
return default_history_data() | ||
return data()[1] | ||
|
||
|
||
def create(): | ||
DbChangeHistory.create(**default_history_data()) | ||
DbChangeHistory.insert_many(data()).execute() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.