Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing error on points_hz template tag for uninitialized user.
* Implemented initial test cases. * Update .travis.yml to install required SQLite packages for testing.
- Loading branch information
1 parent
f6805be
commit dab1845
Showing
6 changed files
with
36 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{% load passive_data_kit %} | ||
{% point_hz source %} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from django.template.loader import render_to_string | ||
from django.test import TestCase | ||
|
||
from .models import DataSource | ||
|
||
class PointsHzTestCase(TestCase): | ||
def setUp(self): | ||
DataSource.objects.create(name='PointsHz Test User', identifier='points-hz-test') | ||
|
||
def test_tests_working(self): | ||
context = { | ||
'source': DataSource.objects.get(identifier='points-hz-test') | ||
} | ||
|
||
result = render_to_string('tests/point_hz_test.txt', context) | ||
|
||
self.assertEqual('<span data-toggle="tooltip" data-placement="top" title=" 0.000 samples per week"> 0.000 mHz</span>', result.strip()) | ||
|
||
def tearDown(self): | ||
DataSource.objects.get(identifier='points-hz-test').delete() |
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