forked from jeffknupp/review
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixes, jeffknupp#2 * unittest2 was replaced by py.test * previous test was repaired * notes on running tests was added to README.md
- Loading branch information
Showing
5 changed files
with
34 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ wsgiref==0.1.2 | |
nose==1.3.0 | ||
coverage==3.7.1 | ||
coveralls | ||
unittest2==0.5.1 | ||
pytest==2.5.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import humanize | ||
def show_stars(score): | ||
return ''.join(['<i class="fa fa-star"></i>' for _ in range(score)]) | ||
return '<i class="fa fa-star"></i>' * score | ||
|
||
def naturaltime(datetime): | ||
return humanize.naturaltime(datetime) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
"""Tests for review app.""" | ||
|
||
from views import app | ||
from unittest2 import TestCase | ||
from .views import app | ||
import pytest | ||
|
||
class ReviewTest(TestCase): | ||
|
||
def setup(self): | ||
self.app = app.test_client() | ||
|
||
def test_simpe(self): | ||
self.assertEquals(1 + 1, 2) | ||
def test_main_list(): | ||
"""Can we successfully retrieve a list of reviews?""" | ||
client = app.test_client() | ||
response = client.get('/') | ||
assert response.status_code == 200 | ||
assert 'Reviews' in response.data | ||
|
||
|
||
def test_simple(): | ||
assert 1 + 1 == 2 | ||
|
||
|
||
if __name__ == '__main__': | ||
pytest.main() | ||
|
||
|
||
def _test_main_list(self): | ||
"""Can we successfully retrieve a list of reviews?""" | ||
response = self.app.get('/') | ||
assert 'All Reviews' in response.data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters