This repository has been archived by the owner on Jan 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use context manager for assertRaises (#537)
* Use context manager for assertRaises, fixes #536. * Update usage of unittest to unittest2. * Remove unneeded `if __name__ == '__main__':` clauses in test files.
- Loading branch information
Showing
24 changed files
with
185 additions
and
279 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
import os | ||
import pickle | ||
import sys | ||
import unittest | ||
import unittest2 | ||
# Mock a Django environment | ||
from django.conf import global_settings | ||
|
||
|
@@ -60,7 +60,7 @@ class DjangoOrmTestApp(AppConfig): | |
__author__ = '[email protected] (Conley Owens)' | ||
|
||
|
||
class TestCredentialsField(unittest.TestCase): | ||
class TestCredentialsField(unittest2.TestCase): | ||
|
||
def setUp(self): | ||
self.fake_model = FakeCredentialsModel() | ||
|
@@ -112,7 +112,7 @@ def test_credentials_without_null(self): | |
self.assertTrue(credentials.null) | ||
|
||
|
||
class TestFlowField(unittest.TestCase): | ||
class TestFlowField(unittest2.TestCase): | ||
|
||
class FakeFlowModel(models.Model): | ||
flow = FlowField() | ||
|
@@ -163,7 +163,7 @@ def test_flow_with_null(self): | |
self.assertTrue(flow.null) | ||
|
||
|
||
class TestStorage(unittest.TestCase): | ||
class TestStorage(unittest2.TestCase): | ||
|
||
def setUp(self): | ||
access_token = 'foo' | ||
|
@@ -317,7 +317,3 @@ def __init__(self, set_store=False, *args, **kwargs): | |
self.deleted = False | ||
|
||
credentials = CredentialsField() | ||
|
||
|
||
if __name__ == '__main__': # pragma: NO COVER | ||
unittest.main() |
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.