This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [x] Added general utility test * [x] Refactored buyer_trend_views * [x] refactored contract_status_view.py * [x] refactored country_partner_view.py * [x] refactored direct_open.py * [x] Refactored equity_summary_view.py, filter_parameters_buyers.py, product_timeline_race_view.py
- Loading branch information
1 parent
c3c59b8
commit 8e8836b
Showing
13 changed files
with
224 additions
and
272 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
Empty file.
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,32 @@ | ||
from django.conf import settings | ||
from django.test import SimpleTestCase | ||
from django.test.utils import override_settings | ||
|
||
from visualization.helpers.general import page_expire_period | ||
from visualization.views.lib.general import add_filter_args | ||
|
||
|
||
class TestGeneral(SimpleTestCase): | ||
@override_settings(DEBUG=False) | ||
def test_page_expire_period(self): | ||
default_timeout = settings.CACHES["default"]["EXPIRE_PERIOD"] | ||
time = page_expire_period() | ||
self.assertEquals(time, default_timeout) | ||
|
||
@override_settings(DEBUG=False) | ||
def test_page_expire_period_specific_page(self): | ||
default_timeout = settings.CACHES["default"]["EXPIRE_PERIOD"] | ||
time = page_expire_period("sample_page") | ||
self.assertEquals(time, default_timeout) | ||
|
||
def test_add_filter_args(self): | ||
result = add_filter_args("foo", "bar", {}) | ||
self.assertEquals(result, {"foo__id": "bar"}) | ||
|
||
def test_add_filter_args_notnull(self): | ||
result = add_filter_args("foo", "notnull", {}) | ||
self.assertEquals(result, {"foo__isnull": False}) | ||
|
||
def test_add_filter_args_append_only(self): | ||
result = add_filter_args("foo", "bar", {}, append_only=True) | ||
self.assertEquals(result, {"foo": "bar"}) |
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
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
Oops, something went wrong.