Skip to content

Commit

Permalink
completely fix tests on Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtepkeev committed Mar 2, 2024
1 parent 20fa9e5 commit b77fb21
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Changelog
**Bugfixes**:

- Tests were failing on Windows OS
- Tests were failing on Python 3.12 (`Issue #332 <https://github.com/maxtepkeev/python-redmine/pull/332>`__)
(thanks to `Michał Górny <https://github.com/mgorny>`__)
- Some closed Issues weren't converted to Resource objects using ``redmine.search()``
- *Pro Edition:* RedmineUP CrmQuery resource ``deals`` and ``contacts`` relation attributes didn't work
- *Pro Edition:* RedmineUP DealStatus resource ``deals`` relation attribute didn't work
Expand Down
3 changes: 2 additions & 1 deletion redminelib/resources/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ def save(self, **attrs):
if not self.is_new():
self.pre_update()
self.manager.update(self.internal_id, **self._changes)
self._decoded_attrs['updated_on'] = datetime.utcnow().strftime(self.manager.redmine.datetime_format)
self._decoded_attrs['updated_on'] = datetime.now(timezone.utc).strftime(
self.manager.redmine.datetime_format)
self.post_update()
else:
self.pre_create()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_redirect_warning(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
self.redmine.engine.request('get', self.url)
self.assertEquals(len(w), 1)
self.assertEqual(len(w), 1)
self.assertIs(w[0].category, exceptions.PerformanceWarning)

def test_engine_is_picklable(self):
Expand Down

0 comments on commit b77fb21

Please sign in to comment.