OH-SHOWN / ohshown-backend

OH!SHOWN 野生動物出沒痕跡通報系統
http://ohshown.site
MIT License
2 stars 8 forks source link

Add const static variable for the hardcode status string #8

Closed tai271828 closed 2 years ago

tai271828 commented 2 years ago

Rebased/cherry-picked necessary commits from https://github.com/tai271828/disfactory-backend/pull/6

Unittest result

================================================== warnings summary ==================================================
towninfo/__init__.py:37: 22 warnings
  /Disfactory/towninfo/__init__.py:37: DeprecationWarning: This method will be removed in future versions.  Use 'list(elem)' or iteration over elem instead.
    for child in tree.getchildren():

api/tests/test_serializers.py::TestFactorySerializers::test_factory_serializer_correct_report_date
  /usr/local/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Factory.status_time received a naive datetime (2021-12-05 06:10:22.877965) while time zone support is active.
    RuntimeWarning)

api/views/tests/test_factory_image_c.py::TestPostFactoryImageView::test_image_upload_db_correct
api/views/tests/test_image_c.py::test_post_image_url
  /usr/local/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Image.orig_time received a naive datetime (2020-03-21 12:33:59) while time zone support is active.
    RuntimeWarning)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
==================================== 54 passed, 1 skipped, 25 warnings in 10.44s =====================================
tai271828 commented 2 years ago

@EagleC0318 , since the commit history of your previous pull request https://github.com/tai271828/disfactory-backend/pull/6 is too complicated and some of the commits are redundant. I rebased your pull request and resolved the conflicts for better commit history maintenance.

Would you mind reviewing this rebased pull request for us to make sure I did understand what you are going to do with your change? If you are OK with my rebased version, I will merge this pull request and then close the other one https://github.com/tai271828/disfactory-backend/pull/6 .

EagleC0318 commented 2 years ago

https://github.com/tai271828/disfactory-backend/pull/8#issuecomment-986101382 Thanks for taking care of the commit history! This PR looks good for me. I think we can merge it after removing the redundant DocumentDisplayStatusEnrichmentEnum.