Use timeutils.utcnow() throughout the code
timeutils.utcnow() should be used instead of direct calls to datetime.datetime.utcnow() to make it easy to override its return value in tests. Add a hacking rule to prevent regressions. Fixes bug 1200141. Change-Id: I170dbd7c9093bd627e2a0d5984b7ad1bf105c8d5
This commit is contained in:
parent
0ef3a5db57
commit
ae7dcbc843
@ -11,6 +11,8 @@ Nova Specific Commandments
|
||||
- ``nova.db`` imports are not allowed in ``nova/virt/*``
|
||||
- [N309] no db session in public API methods (disabled)
|
||||
This enforces a guideline defined in ``nova.openstack.common.db.sqlalchemy.session``
|
||||
- [N310] timeutils.utcnow() wrapper must be used instead of direct calls to
|
||||
datetime.datetime.utcnow() to make it easy to override its return value in tests
|
||||
|
||||
Creating Unit Tests
|
||||
-------------------
|
||||
|
Loading…
Reference in New Issue
Block a user