Fix up a couple unit tests that relied on database ordering.

Review Request #8691 — Created Jan. 31, 2017 and submitted

Information

Review Board
release-3.0.x
dd819b3...

Reviewers

There were a couple unit tests that checked the order of comments returned in a
query after saving. This test was somewhat fragile to the way that the database
backend would decide to return them, and had started failing for me. Since we
care specifically about the order of the timestamps, I've fixed up the tests to
provide order_by('timestamp') and the tests pass as expected.

Ran unit tests.

Description From Last Updated

'FileAttachment' imported but unused

reviewbotreviewbot

'ReviewRequestDraft' imported but unused

reviewbotreviewbot

'ReviewRequest' imported but unused

reviewbotreviewbot

'Screenshot' imported but unused

reviewbotreviewbot

Can you put the ending ) on its own line? That's how we have it for the other multi-line queries.

chipx86chipx86

Same here.

chipx86chipx86
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/tests/test_views.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/tests/test_views.py
    
    
  2. reviewboard/reviews/tests/test_views.py (Diff revision 1)
     
     
    Show all issues
     'FileAttachment' imported but unused
    
  3. reviewboard/reviews/tests/test_views.py (Diff revision 1)
     
     
    Show all issues
     'ReviewRequestDraft' imported but unused
    
  4. reviewboard/reviews/tests/test_views.py (Diff revision 1)
     
     
    Show all issues
     'ReviewRequest' imported but unused
    
  5. reviewboard/reviews/tests/test_views.py (Diff revision 1)
     
     
    Show all issues
     'Screenshot' imported but unused
    
  6. 
      
david
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/tests/test_views.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/tests/test_views.py
    
    
  2. 
      
chipx86
  1. 
      
  2. reviewboard/reviews/tests/test_views.py (Diff revision 2)
     
     
     
     
     
    Show all issues

    Can you put the ending ) on its own line? That's how we have it for the other multi-line queries.

  3. reviewboard/reviews/tests/test_views.py (Diff revision 2)
     
     
     
     
     
    Show all issues

    Same here.

  4. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.0.x (9ae3573)