Skip to content

Chore add admin report serializer#130

Closed
maciejSamerdak wants to merge 2 commits intomasterfrom
chore-add-admin-report-serializer
Closed

Chore add admin report serializer#130
maciejSamerdak wants to merge 2 commits intomasterfrom
chore-add-admin-report-serializer

Conversation

@maciejSamerdak
Copy link
Collaborator

@maciejSamerdak maciejSamerdak commented Apr 15, 2019

Introduces serializer for administrative purposes which will be used by both project-report-detail and admin-report-detail introduced in upcoming PRs.

Do not delete this branch until #131 and #133 are merged

description=self.required_input["description"],
author=self.required_input["author"],
project=self.required_input["project"],
work_hours=Decimal("8.00"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not self.required_input["work_hours"]?

def test_report_serializer_creation_date_field_should_ignore_input_on_model_update(self):
timestamp = datetime.datetime(2001, 1, 1, 0, 0, 0, 0)
report = Report(
date=datetime.datetime.now().date(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use django.utils.timezone.

description=self.required_input["description"],
author=self.required_input["author"],
project=self.required_input["project"],
work_hours=Decimal("8.00"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

def test_report_serializer_last_update_field_should_ignore_input_on_model_update(self):
timestamp = datetime.datetime(2001, 1, 1, 0, 0, 0, 0)
report = Report(
date=datetime.datetime.now().date(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

description=self.required_input["description"],
author=self.required_input["author"],
project=self.required_input["project"],
work_hours=Decimal("8.00"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.


def test_report_serializer_editable_field_should_ignore_input_on_model_update(self):
report = Report(
date=datetime.datetime.now().date(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@rwrzesien
Copy link
Contributor

Looks good in general, some small improvements can be applied to tests. But the general question is - do we still need to add new serializers after we agreed to drop rest framework in favor of django views?

@kbeker
Copy link
Contributor

kbeker commented Apr 29, 2019

This changes are unnecessary. I'm closing it

@kbeker kbeker closed this Apr 29, 2019
@kbeker kbeker deleted the chore-add-admin-report-serializer branch May 10, 2019 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Ivisible feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants