Skip to content
Merged
Prev Previous commit
Next Next commit
feat: TT-401 validated request create time entry
  • Loading branch information
ararcos committed Nov 19, 2021
commit 39d2b243437ca05a4944d5ee53eefa7e350b8e61
6 changes: 5 additions & 1 deletion V2/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
@pytest.fixture(name='activity_factory')
def _activity_factory() -> activities_domain.Activity:
def _make_activity(
name: str = Faker().name(), description: str = Faker().sentence(), deleted: bool = False, status: int = 1
name: str = Faker().name(),
description: str = Faker().sentence(),
deleted: bool = False,
status: int = 1,
):
activity = activities_domain.Activity(
id=None,
Expand All @@ -20,6 +23,7 @@ def _make_activity(
status=status
)
return activity

return _make_activity


Expand Down
20 changes: 8 additions & 12 deletions V2/tests/integration/daos/time_entries_dao.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,17 @@ def test_create_time_entry__returns_an_time_entry_dto__when_create_an_time_entry

time_entries_json_dao = TimeEntriesJsonDao(Faker().file_path())
time_entry_data = {
"id" : None,
"start_date" : Faker().date(),
"owner_id" : Faker().random_int(),
"id": None,
"start_date": Faker().date(),
"owner_id": Faker().random_int(),
"description": Faker().sentence(),
"activity_id" : Faker().random_int(),
"uri": "http://hola.com",
"technologies" : ["jira","git"],
"activity_id": Faker().random_int(),
"uri": "http://timetracker.com",
"technologies": ["jira", "git"],
"end_date": Faker().date(),
"deleted": Faker().random_int(),
"timezone_offset": "UTC-5",
"deleted": False,
"timezone_offset": "300",
"project_id": Faker().random_int(),
}
result = time_entries_json_dao.create(time_entry_data)
assert result == TimeEntry(**time_entry_data)




Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from time_tracker._infrastructure import DB



def create_time_entry(req: func.HttpRequest) -> func.HttpResponse:
database = DB()
time_entry_dao = _infrastructure.TimeEntriesSQLDao(database)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,92 +1 @@
[{
"id": null,
"start_date": "12/07/2021",
"owner_id": 2,
"tenant_id": "asdasdsa",
"description": "No se que poner jajaj ",
"activity_id": 2,
"uri": "http://hola.que.hace.com",
"technologies": ["git", "jira", "python"],
"end_date": "12/07/2021",
"deleted": "asdasdsaadssa",
"timezone_offset": "asdasdsa",
"project_id": 1
}, {
"id": null,
"start_date": "12/07/2021",
"owner_id": 2,
"tenant_id": "asdasdsa",
"description": "No se que poner jajaj ",
"activity_id": 2,
"uri": "http://hola.que.hace.com",
"technologies": ["git", "jira", "python"],
"end_date": "12/07/2021",
"deleted": "asdasdsaadssa",
"timezone_offset": "asdasdsa",
"project_id": 1
}, {
"id": null,
"start_date": "12/07/2021",
"owner_id": 2,
"tenant_id": "asdasdsa",
"description": "No se que poner jajaj ",
"activity_id": 2,
"uri": "http://hola.que.hace.com",
"technologies": ["git", "jira", "python"],
"end_date": "12/07/2021",
"deleted": "asdasdsaadssa",
"timezone_offset": "asdasdsa",
"project_id": 1
}, {
"id": null,
"start_date": "12/07/2021",
"owner_id": 2,
"tenant_id": "asdasdsa",
"description": "No se que poner jajaj ",
"activity_id": 2,
"uri": "http://hola.que.hace.com",
"technologies": ["git", "jira", "python"],
"end_date": "12/07/2021",
"deleted": "asdasdsaadssa",
"timezone_offset": "asdasdsa",
"project_id": 1
}, {
"id": null,
"start_date": "12/07/2021",
"owner_id": 2,
"tenant_id": "asdasdsa",
"description": "No se que poner jajaj ",
"activity_id": 2,
"uri": "http://hola.que.hace.com",
"technologies": ["git", "jira", "python"],
"end_date": "12/07/2021",
"deleted": "asdasdsaadssa",
"timezone_offset": "asdasdsa",
"project_id": 1
}, {
"id": null,
"start_date": "12/07/2021",
"owner_id": 2,
"tenant_id": "asdasdsa",
"description": "No se que poner jajaj ",
"activity_id": 2,
"uri": "http://hola.que.hace.com",
"technologies": ["git", "jira", "python"],
"end_date": "12/07/2021",
"deleted": "asdasdsaadssa",
"timezone_offset": "asdasdsa",
"project_id": 1
}, {
"id": null,
"start_date": "12/07/2021",
"owner_id": 2,
"tenant_id": "asdasdsa",
"description": "No se que poner jajaj ",
"activity_id": 2,
"uri": "http://hola.que.hace.com",
"technologies": ["git", "jira", "python"],
"end_date": "12/07/2021",
"deleted": "asdasdsaadssa",
"timezone_offset": "asdasdsa",
"project_id": 1
}]
[{"id": null, "start_date": "12/07/2021", "owner_id": 2, "tenant_id": "asdasdsa", "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": "asdasdsaadssa", "timezone_offset": "asdasdsa", "project_id": 1}, {"id": null, "start_date": "12/07/2021", "owner_id": 2, "tenant_id": "asdasdsa", "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": "asdasdsaadssa", "timezone_offset": "asdasdsa", "project_id": 1}, {"id": null, "start_date": "12/07/2021", "owner_id": 2, "tenant_id": "asdasdsa", "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": "asdasdsaadssa", "timezone_offset": "asdasdsa", "project_id": 1}, {"id": null, "start_date": "12/07/2021", "owner_id": 2, "tenant_id": "asdasdsa", "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": "asdasdsaadssa", "timezone_offset": "asdasdsa", "project_id": 1}, {"id": null, "start_date": "12/07/2021", "owner_id": 2, "tenant_id": "asdasdsa", "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": "asdasdsaadssa", "timezone_offset": "asdasdsa", "project_id": 1}, {"id": null, "start_date": "12/07/2021", "owner_id": 2, "tenant_id": "asdasdsa", "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": "asdasdsaadssa", "timezone_offset": "asdasdsa", "project_id": 1}, {"id": null, "start_date": "12/07/2021", "owner_id": 2, "tenant_id": "asdasdsa", "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": "asdasdsaadssa", "timezone_offset": "asdasdsa", "project_id": 1}, {"id": null, "start_date": "12/07/2021", "owner_id": 2, "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": "asdasdsaadssa", "timezone_offset": "asdasdsa", "project_id": 1}, {"id": null, "start_date": "12/07/2021", "owner_id": 2, "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": false, "timezone_offset": "asdasdsa", "project_id": 1}, {"id": null, "start_date": "12/07/2021", "owner_id": "2", "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": false, "timezone_offset": "asdasdsa", "project_id": 1}, {"id": null, "start_date": "12/07/2021", "owner_id": "2", "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": false, "timezone_offset": "asdasdsa", "project_id": 1}, {"id": null, "start_date": "12/07/2021", "owner_id": "2", "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": false, "timezone_offset": "asdasdsa", "project_id": 1}, {"id": null, "start_date": "12/07/2021", "owner_id": "2", "description": "No se que poner jajaj ", "activity_id": 2, "uri": "http://hola.que.hace.com", "technologies": ["git", "jira", "python"], "end_date": "12/07/2021", "deleted": false, "timezone_offset": "asdasdsa", "project_id": 1}]