-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from fga-gpp-mds/devel
TS13-StandardizeTests
- Loading branch information
Showing
65 changed files
with
441 additions
and
789 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,13 +12,13 @@ def setUp(self): | |
self.health_professional = User.objects.create_user(email='[email protected]', | ||
password='teste') | ||
|
||
def test_request_autocomplete_cid_fail(self): | ||
def test_chat_request_autocomplete_cid_fail(self): | ||
request = self.factory.get('/chat/ajax/autocomplete_email/?search=test') | ||
request.user = self.health_professional | ||
response = AutoCompleteEmail.as_view()(request) | ||
self.assertNotEquals(response, HttpResponse) | ||
|
||
def test_request_autocomplete_cid_return_one_disease(self): | ||
def test_chat_request_autocomplete_cid_return_one_disease(self): | ||
request = self.factory.get('/chat/ajax/autocomplete_email/?search=test', | ||
HTTP_X_REQUESTED_WITH='XMLHttpRequest') | ||
|
||
|
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 |
---|---|---|
|
@@ -27,22 +27,22 @@ def setUp(self): | |
self.message.pk = '1' | ||
self.message.save() | ||
|
||
def test_queryset_true(self): | ||
def test_chat_queryset_true(self): | ||
request = self.view_class.as_view() | ||
request.user = self.user | ||
|
||
self.view.request = request | ||
query = self.view.get_queryset() | ||
self.assertTrue(query.exists()) | ||
|
||
def test_get_context_true(self): | ||
def test_chat_get_context_true(self): | ||
request = self.factory.get('/') | ||
request.user = self.user | ||
self.view.request = request | ||
self.view.object = self.message | ||
self.assertEqual(type(self.view.get_context_data()), type(dict())) | ||
|
||
def test_post_true(self): | ||
def test_chat_post_true(self): | ||
request = self.factory.post('/', | ||
{'text': 'isso e um texto', | ||
'user_to': '[email protected]', | ||
|
@@ -54,7 +54,7 @@ def test_post_true(self): | |
response = self.view_class.as_view()(request, pk=1) | ||
self.assertEqual(response.status_code, 302) | ||
|
||
def test_post_false(self): | ||
def test_chat_post_false(self): | ||
request = self.factory.post('/', | ||
{'user_to': '[email protected]', | ||
'user_from': '[email protected]'}) | ||
|
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 |
---|---|---|
|
@@ -27,22 +27,22 @@ def setUp(self): | |
self.message.pk = '1' | ||
self.message.save() | ||
|
||
def test_queryset_true(self): | ||
def test_chat_queryset_true(self): | ||
request = self.view_class.as_view() | ||
request.user = self.user | ||
|
||
self.view.request = request | ||
query = self.view.get_queryset() | ||
self.assertTrue(query.exists()) | ||
|
||
def test_get_context_true(self): | ||
def test_chat_get_context_true(self): | ||
request = self.factory.get('/') | ||
request.user = self.user | ||
self.view.request = request | ||
self.view.object = self.message | ||
self.assertEqual(type(self.view.get_context_data()), type(dict())) | ||
|
||
def test_post_true(self): | ||
def test_chat_post_true(self): | ||
request = self.factory.post('/', | ||
{'text': 'isso e um texto', | ||
'user_to': '[email protected]', | ||
|
@@ -54,7 +54,7 @@ def test_post_true(self): | |
response = self.view_class.as_view()(request, pk=1) | ||
self.assertEqual(response.status_code, 302) | ||
|
||
def test_post_false(self): | ||
def test_chat_post_false(self): | ||
request = self.factory.post('/', | ||
{'user_to': '[email protected]', | ||
'user_from': '[email protected]'}) | ||
|
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 @@ | ||
from . import * |
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 |
---|---|---|
|
@@ -22,53 +22,53 @@ def setUp(self): | |
self.user = User.objects.create_user(email='[email protected]', password='senha12') | ||
self.description = "Examina alguma coisa" | ||
|
||
def test_get_without_login(self): | ||
def teste_exam_get_without_login(self): | ||
request = self.factory.get('/exam/create_custom_exams/') | ||
request.user = AnonymousUser() | ||
|
||
response = CreateCustomExamsView.as_view()(request) | ||
self.assertEqual(response.status_code, 302) | ||
|
||
def test_get_with_patient(self): | ||
def teste_exam_get_with_patient(self): | ||
request = self.factory.get('/exam/create_custom_exams/') | ||
request.user = self.patient | ||
|
||
response = CreateCustomExamsView.as_view()(request) | ||
self.assertEqual(response.status_code, 302) | ||
|
||
def test_get_with_user(self): | ||
def teste_exam_get_with_user(self): | ||
request = self.factory.get('/exam/create_custom_exams/') | ||
request.user = self.user | ||
|
||
response = CreateCustomExamsView.as_view()(request) | ||
self.assertEqual(response.status_code, 302) | ||
|
||
def test_get_with_health_professional(self): | ||
def teste_exam_get_with_health_professional(self): | ||
request = self.factory.get('/exam/create_custom_exams/') | ||
request.user = self.health_professional | ||
|
||
response = CreateCustomExamsView.as_view()(request) | ||
self.assertEqual(response.status_code, 200) | ||
|
||
def test_post_without_login(self): | ||
def teste_exam_post_without_login(self): | ||
request = self.factory.post('/exam/create_custom_exams/', {'name': '', 'description': self.description}) | ||
request.user = AnonymousUser() | ||
response = CreateCustomExamsView.as_view()(request) | ||
self.assertEqual(response.status_code, 302) | ||
|
||
def test_post_with_patient(self): | ||
def teste_exam_post_with_patient(self): | ||
request = self.factory.post('/exam/create_custom_exams/', {'name': '', 'description': self.description}) | ||
request.user = self.patient | ||
response = CreateCustomExamsView.as_view()(request) | ||
self.assertEqual(response.status_code, 302) | ||
|
||
def test_post_with_user(self): | ||
def teste_exam_post_with_user(self): | ||
request = self.factory.post('/exam/create_custom_exams/', {'name': '', 'description': self.description}) | ||
request.user = self.user | ||
response = CreateCustomExamsView.as_view()(request) | ||
self.assertEqual(response.status_code, 302) | ||
|
||
def test_post_with_health_professional(self): | ||
def teste_exam_post_with_health_professional(self): | ||
request = self.factory.post('/exam/create_custom_exams/', {'name': '', 'description': self.description}) | ||
request.user = self.health_professional | ||
response = CreateCustomExamsView.as_view()(request) | ||
|
Oops, something went wrong.