diff --git a/chcemvediet/apps/accounts/tests/skip_test_views.py b/chcemvediet/apps/accounts/tests/test_views.py similarity index 96% rename from chcemvediet/apps/accounts/tests/skip_test_views.py rename to chcemvediet/apps/accounts/tests/test_views.py index 55d1bb084..70444053e 100644 --- a/chcemvediet/apps/accounts/tests/skip_test_views.py +++ b/chcemvediet/apps/accounts/tests/test_views.py @@ -1,5 +1,7 @@ # vim: expandtab # -*- coding: utf-8 -*- +import unittest + from django.core.urlresolvers import reverse from django.http import HttpResponse from django.contrib.auth.models import User @@ -23,6 +25,7 @@ def test_allowed_http_methods(self): allowed = [u'HEAD', u'GET'] self.assert_allowed_http_methods(allowed, reverse(u'accounts:profile')) + @unittest.skip(u'FIXME') def test_anonymous_user_is_redirected(self): self.assert_anonymous_user_is_redirected(reverse(u'accounts:profile')) diff --git a/chcemvediet/apps/obligees/tests/skip_test_views.py b/chcemvediet/apps/obligees/tests/test_views.py similarity index 95% rename from chcemvediet/apps/obligees/tests/skip_test_views.py rename to chcemvediet/apps/obligees/tests/test_views.py index 719f5bd80..30c436e2e 100644 --- a/chcemvediet/apps/obligees/tests/skip_test_views.py +++ b/chcemvediet/apps/obligees/tests/test_views.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import random import json +import unittest from django.core.urlresolvers import reverse from django.http import JsonResponse @@ -26,6 +27,7 @@ def test_obligees_index(self): self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, u'obligees/index.html') + @unittest.skip(u'FIXME') def test_paginator_with_no_page_number_shows_first_page(self): oblgs = [self._create_obligee() for i in range(51)] response = self.client.get(reverse(u'obligees:index')) @@ -33,6 +35,7 @@ def test_paginator_with_no_page_number_shows_first_page(self): self.assertEqual(repr(response.context[u'obligee_page']), u'') self.assertEqual(list(response.context[u'obligee_page']), oblgs[:25]) + @unittest.skip(u'FIXME') def test_paginator_with_valid_page_number_shows_requested_page(self): oblgs = [self._create_obligee() for i in range(51)] response = self.client.get(reverse(u'obligees:index') + u'?page=2') @@ -40,6 +43,7 @@ def test_paginator_with_valid_page_number_shows_requested_page(self): self.assertEqual(repr(response.context[u'obligee_page']), u'') self.assertEqual(list(response.context[u'obligee_page']), oblgs[25:50]) + @unittest.skip(u'FIXME') def test_paginator_with_too_high_page_number_shows_last_page(self): oblgs = [self._create_obligee() for i in range(51)] response = self.client.get(reverse(u'obligees:index') + u'?page=47') @@ -47,6 +51,7 @@ def test_paginator_with_too_high_page_number_shows_last_page(self): self.assertEqual(repr(response.context[u'obligee_page']), u'') self.assertEqual(list(response.context[u'obligee_page']), oblgs[50:]) + @unittest.skip(u'FIXME') def test_paginator_with_invalid_page_number_shows_first_page(self): oblgs = [self._create_obligee() for i in range(51)] response = self.client.get(reverse(u'obligees:index') + u'?page=invalid') @@ -69,6 +74,7 @@ def test_allowed_http_methods(self): allowed = [u'HEAD', u'GET'] self.assert_allowed_http_methods(allowed, reverse(u'obligees:autocomplete')) + @unittest.skip(u'FIXME') def test_autocomplete_returns_json_with_correct_structure(self): oblg1 = self._create_obligee(name=u'Agency', street=u'Westend', city=u'Winterfield', zip=u'12345', emails=u'agency@a.com') oblg2 = self._create_obligee(name=u'Ministry', street=u'Eastend', city=u'Springfield', zip=u'12345', emails=u'ministry@a.com') @@ -105,6 +111,7 @@ def test_autocomplete_returns_json_with_correct_structure(self): }, ]) + @unittest.skip(u'FIXME') def test_autocomplete_is_case_insensitive(self): names = [u'aaa', u'AAA', u'AaA', u'ddd', u'Ddd', u'eee'] oblgs = [self._create_obligee(name=n) for n in names] @@ -114,6 +121,7 @@ def test_autocomplete_is_case_insensitive(self): found = [d[u'obligee'][u'name'] for d in data] self.assertItemsEqual(found, [u'aaa', u'AAA', u'AaA']) + @unittest.skip(u'FIXME') def test_autocomplete_ignores_accents(self): names = [u'aáá', u'aää', u'aÁÄ', u'aaa', u'ddd', u'eee'] oblgs = [self._create_obligee(name=n) for n in names] @@ -123,6 +131,7 @@ def test_autocomplete_ignores_accents(self): found = [d[u'obligee'][u'name'] for d in data] self.assertItemsEqual(found, [u'aáá', u'aää', u'aÁÄ', u'aaa']) + @unittest.skip(u'FIXME') def test_autocomplete_with_multiple_words(self): names = [u'aaa bbb ccc', u'bbb aaa', u'aaa ccc', u'ddd'] oblgs = [self._create_obligee(name=n) for n in names] @@ -132,6 +141,7 @@ def test_autocomplete_with_multiple_words(self): found = [d[u'obligee'][u'name'] for d in data] self.assertItemsEqual(found, [u'aaa bbb ccc']) + @unittest.skip(u'FIXME') def test_autocomplete_matches_obligee_name_prefixes(self): names = [u'aa', u'aaa', u'aaaaaaa', u'aaaxxxx', u'xxxxaaa', u'xxxxaaaxxxx', u'xxx aaa', u'xxx aaax xxx'] oblgs = [self._create_obligee(name=n) for n in names] @@ -141,6 +151,7 @@ def test_autocomplete_matches_obligee_name_prefixes(self): found = [d[u'obligee'][u'name'] for d in data] self.assertItemsEqual(found, [u'aaa', u'aaaaaaa', u'aaaxxxx', u'xxx aaa', u'xxx aaax xxx']) + @unittest.skip(u'FIXME') def test_autocomplete_without_term_returns_everything(self): names = [u'aaa', u'bbb', u'ccc', u'ddd'] oblgs = [self._create_obligee(name=n) for n in names] @@ -150,6 +161,7 @@ def test_autocomplete_without_term_returns_everything(self): found = [d[u'obligee'][u'name'] for d in data] self.assertItemsEqual(found, [u'aaa', u'bbb', u'ccc', u'ddd']) + @unittest.skip(u'FIXME') def test_autocomplete_returns_only_pending_obligees(self): oblg1 = self._create_obligee(name=u'aaa 1', status=Obligee.STATUSES.PENDING) oblg2 = self._create_obligee(name=u'aaa 2', status=Obligee.STATUSES.PENDING) @@ -161,6 +173,7 @@ def test_autocomplete_returns_only_pending_obligees(self): found = [d[u'obligee'][u'name'] for d in data] self.assertItemsEqual(found, [u'aaa 1', u'aaa 2']) + @unittest.skip(u'FIXME') def test_autocomplete_returns_at_most_10_obligees(self): oblgs = [self._create_obligee(name=u'aaa %02d' % i) for i in range(25)] response = self.client.get(reverse(u'obligees:autocomplete') + u'?term=aaa') @@ -168,6 +181,7 @@ def test_autocomplete_returns_at_most_10_obligees(self): data = json.loads(response.content) self.assertEqual(len(data), 10) + @unittest.skip(u'FIXME') def test_autocomplete_returns_obligees_ordered_by_name(self): names = [u'aaa', u'aaa bbb1', u'aaa bbb2', u'aaa ccc', u'aaa ddd', u'eee aaa', u'fff', u'ggg aaa', u'hhh'] random.shuffle(names) diff --git a/chcemvediet/tests/skip_test_views.py b/chcemvediet/tests/test_views.py similarity index 89% rename from chcemvediet/tests/skip_test_views.py rename to chcemvediet/tests/test_views.py index 3a0335156..f8e8ce334 100644 --- a/chcemvediet/tests/skip_test_views.py +++ b/chcemvediet/tests/test_views.py @@ -1,5 +1,7 @@ # vim: expandtab # -*- coding: utf-8 -*- +import unittest + from django.core.urlresolvers import reverse from django.test import TestCase @@ -10,10 +12,12 @@ class IndexViewTest(ViewTestCaseMixin, TestCase): Tests ``index()`` view registered as "index". """ + @unittest.skip(u'FIXME') def test_allowed_http_methods(self): allowed = [u'HEAD', u'GET'] self.assert_allowed_http_methods(allowed, reverse(u'index')) + @unittest.skip(u'FIXME') def test_index(self): response = self.client.get(reverse(u'index')) self.assertEqual(response.status_code, 200) @@ -24,10 +28,12 @@ class AboutViewTest(ViewTestCaseMixin, TestCase): Tests ``about()`` view registered as "about". """ + @unittest.skip(u'FIXME') def test_allowed_http_methods(self): allowed = [u'HEAD', u'GET'] self.assert_allowed_http_methods(allowed, reverse(u'about')) + @unittest.skip(u'FIXME') def test_about(self): response = self.client.get(reverse(u'about')) self.assertEqual(response.status_code, 200) diff --git a/poleno/mail/tests/skip_test_cron.py b/poleno/mail/tests/test_cron.py similarity index 100% rename from poleno/mail/tests/skip_test_cron.py rename to poleno/mail/tests/test_cron.py diff --git a/poleno/mail/tests/skip_test_dummy.py b/poleno/mail/tests/test_dummy.py similarity index 100% rename from poleno/mail/tests/skip_test_dummy.py rename to poleno/mail/tests/test_dummy.py diff --git a/poleno/mail/tests/skip_test_imap.py b/poleno/mail/tests/test_imap.py similarity index 99% rename from poleno/mail/tests/skip_test_imap.py rename to poleno/mail/tests/test_imap.py index 47d569e55..95b78b833 100644 --- a/poleno/mail/tests/skip_test_imap.py +++ b/poleno/mail/tests/test_imap.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import mock import datetime +import unittest from textwrap import dedent from django.conf import settings @@ -299,6 +300,7 @@ def test_mail_with_both_text_and_html_alternatives(self): self.assertEqual(msg.html, u'

HTML content

') self.assertEqual(msg.attachment_set.count(), 0) + @unittest.skip(u'FIXME') def test_mail_with_multiple_text_and_html_alternatives_stored_as_attachments(self): mail = self._create_mail(body=dedent(u"""\ --===============1111111111== @@ -344,6 +346,7 @@ def test_mail_with_multiple_text_and_html_alternatives_stored_as_attachments(sel self.assertEqual(attchs[1].content_type, u'text/html') self.assertEqual(attchs[1].content, u'

HTML content 2

') + @unittest.skip(u'FIXME') def test_mail_with_attachment(self): mail = self._create_mail(body=dedent(u"""\ --===============1111111111== @@ -368,6 +371,7 @@ def test_mail_with_attachment(self): self.assertEqual(attchs[0].content_type, u'application/pdf') self.assertEqual(attchs[0].content, u'(content)') + @unittest.skip(u'FIXME') def test_mail_with_attachment_without_filename(self): mail = self._create_mail(body=dedent(u"""\ --===============1111111111== @@ -421,6 +425,7 @@ def test_mail_without_text_body_but_with_text_attachment(self): self.assertEqual(attchs[0].content_type, u'text/plain') self.assertEqual(attchs[0].content, u'(attachment content)') + @unittest.skip(u'FIXME') def test_mail_without_html_body_but_with_html_attachment(self): u""" Checks that "text/html" attachment is stored as an attachment even if there is no diff --git a/poleno/mail/tests/skip_test_mandrill.py b/poleno/mail/tests/test_mandrill.py similarity index 98% rename from poleno/mail/tests/skip_test_mandrill.py rename to poleno/mail/tests/test_mandrill.py index 15b31db4f..fba4afea5 100644 --- a/poleno/mail/tests/skip_test_mandrill.py +++ b/poleno/mail/tests/test_mandrill.py @@ -4,6 +4,7 @@ import mock import datetime import contextlib +import unittest from django.core.urlresolvers import reverse from django.core.exceptions import ImproperlyConfigured @@ -208,6 +209,7 @@ def test_message_to_cc_and_bcc_recipients(self): {u'type': u'bcc', u'email': u'bcc2@a.com'}, ]) + @unittest.skip(u'FIXME') def test_message_attachments(self): msg = self._create_message() rcpt = self._create_recipient(message=msg) @@ -326,21 +328,24 @@ def _check_response(self, response, klass=HttpResponse, status_code=200, content if content is not None: self.assertEqual(response.content, content) - + @unittest.skip(u'FIXME') def test_allowed_http_methods(self): allowed = [u'HEAD', u'GET', u'POST'] self.assert_allowed_http_methods(allowed, self._webhook_url()) + @unittest.skip(u'FIXME') def test_post_method_needs_signature(self): with self._overrides(): response = self.client.post(self._webhook_url(), secure=True) self._check_response(response, HttpResponseForbidden, 403, u'X-Mandrill-Signature not set') + @unittest.skip(u'FIXME') def test_non_secure_requests_forbidden(self): with self._overrides(): response = self.client.head(self._webhook_url(), secure=False) self._check_response(response, HttpResponseForbidden, 403) + @unittest.skip(u'FIXME') def test_undefined_webhook_secret_raises_exception(self): with self._overrides(delete_settings=[u'MANDRILL_WEBHOOK_SECRET']): with self.assertRaisesMessage(ImproperlyConfigured, u'Setting MANDRILL_WEBHOOK_SECRET is not set.'): @@ -356,16 +361,19 @@ def test_webhook_secret_with_default_name_matches(self): response = self.client.head(self._webhook_url(u'secret', u'value'), secure=True) self._check_response(response) + @unittest.skip(u'FIXME') def test_webhook_secret_with_custom_name_does_not_match(self): with self._overrides(MANDRILL_WEBHOOK_SECRET_NAME=u'custom_name', MANDRILL_WEBHOOK_SECRET=u'value'): response = self.client.head(self._webhook_url(u'custom_name', u'wrong_value'), secure=True) self._check_response(response, HttpResponseForbidden, 403) + @unittest.skip(u'FIXME') def test_webhook_secret_with_default_name_does_not_match(self): with self._overrides(MANDRILL_WEBHOOK_SECRET=u'value', delete_settings=[u'MANDRILL_WEBHOOK_SECRET_NAME']): response = self.client.head(self._webhook_url(u'secret', u'wrong_value'), secure=True) self._check_response(response, HttpResponseForbidden, 403) + @unittest.skip(u'FIXME') def test_undefined_webhook_url_raises_exception_for_post_request(self): with self._overrides(delete_settings=[u'MANDRILL_WEBHOOK_URL']): with self.assertRaisesMessage(ImproperlyConfigured, u'Setting MANDRILL_WEBHOOK_URL is not set.'): @@ -376,6 +384,7 @@ def test_undefined_webhook_url_does_not_raise_exception_for_head_request(self): response = self.client.head(self._webhook_url(), secure=True) self._check_response(response) + @unittest.skip(u'FIXME') def test_undefined_webhook_keys_raises_exception_for_post_request(self): with self._overrides(delete_settings=[u'MANDRILL_WEBHOOK_KEYS']): with self.assertRaisesMessage(ImproperlyConfigured, u'Setting MANDRILL_WEBHOOK_KEYS is not set.'): @@ -386,11 +395,13 @@ def test_undefined_webhook_keys_does_not_raise_exception_for_head_request(self): response = self.client.head(self._webhook_url(), secure=True) self._check_response(response) + @unittest.skip(u'FIXME') def test_post_request_with_missing_signature_forbidden(self): with self._overrides(): response = self.client.post(self._webhook_url(), secure=True) self._check_response(response, HttpResponseForbidden, 403, u'X-Mandrill-Signature not set') + @unittest.skip(u'FIXME') def test_post_request_with_invalid_signature_forbidden(self): with self._overrides(): response = self.client.post(self._webhook_url(), secure=True, HTTP_X_MANDRILL_SIGNATURE=u'invalid') @@ -403,12 +414,14 @@ def test_post_request_with_valid_signature(self): HTTP_X_MANDRILL_SIGNATURE=u'mOvq6ELcRGPELc0BwAFZn/PLZQA=') self._check_response(response) + @unittest.skip(u'FIXME') def test_post_request_with_missing_data_returns_bad_request(self): with self._overrides(MANDRILL_WEBHOOK_URL=u'https://testhost/', MANDRILL_WEBHOOK_KEYS=[u'testkey']): response = self.client.post(self._webhook_url(), secure=True, HTTP_X_MANDRILL_SIGNATURE=u'UkKakpnkvjXLMRLs1kVknNgKXpk=') self._check_response(response, HttpResponseBadRequest, 400, u'Request syntax error') + @unittest.skip(u'FIXME') def test_post_request_with_invalid_data_returns_bad_request(self): with self._overrides(MANDRILL_WEBHOOK_URL=u'https://testhost/', MANDRILL_WEBHOOK_KEYS=[u'testkey']): response = self.client.post(self._webhook_url(), secure=True, @@ -433,7 +446,7 @@ def test_post_request_with_valid_data_emits_webhook_events(self): mock.call(signal=webhook_event, data={u'_id': u'remote-2', u'event': u'soft_bounce'}, event_type=u'soft_bounce', sender=None), mock.call(signal=webhook_event, data={u'_id': u'remote-3', u'event': u'click'}, event_type=u'click', sender=None), ]) - + @unittest.skip(u'FIXME') def test_post_request_with_valid_data_rolls_back_if_exception_raised(self): def receiver(*args, **kwargs): self._create_message() @@ -674,6 +687,7 @@ def test_message_recipients_status_is_inbound(self): for rcpt in msgs[0].recipient_set.all(): self.assertEqual(rcpt.status, Recipient.STATUSES.INBOUND) + @unittest.skip(u'FIXME') def test_message_attachments(self): msgs = self._call_webhook(attachments={ u'file.txt': {u'name': u'file.txt', u'type': u'text/plain', u'content': u'Text Content'}, diff --git a/poleno/mail/tests/skip_test_smtp.py b/poleno/mail/tests/test_smtp.py similarity index 99% rename from poleno/mail/tests/skip_test_smtp.py rename to poleno/mail/tests/test_smtp.py index 416e58cfe..50675c8a4 100644 --- a/poleno/mail/tests/skip_test_smtp.py +++ b/poleno/mail/tests/test_smtp.py @@ -1,6 +1,7 @@ # vim: expandtab # -*- coding: utf-8 -*- import mock +import unittest from textwrap import dedent from collections import defaultdict @@ -135,6 +136,7 @@ def test_message_with_html_body_only(self):

HTML content

--===============.*==--""")) + @unittest.skip(u'FIXME') def test_message_with_both_text_and_html_body(self): msg = self._create_message(text=u'Text content', html=u'

HTML content

') rcpt = self._create_recipient(message=msg) @@ -177,6 +179,7 @@ def test_message_with_extra_headers(self): self.assertEqual(result[0].headers[u'X-Some-Header'], [u'Value']) self.assertEqual(result[0].headers[u'X-Another-Header'], [u'Another Value']) + @unittest.skip(u'FIXME') def test_message_with_attachments(self): msg = self._create_message(text=u'Text content', html=u'

HTML content

') rcpt = self._create_recipient(message=msg) diff --git a/poleno/utils/skip_test.py b/poleno/utils/test.py similarity index 99% rename from poleno/utils/skip_test.py rename to poleno/utils/test.py index ddf0830ed..eac8b9ebf 100644 --- a/poleno/utils/skip_test.py +++ b/poleno/utils/test.py @@ -6,7 +6,7 @@ from django.utils.http import urlencode from django.test import TestCase -from poleno.utils.views import reverse +from poleno.utils.urls import reverse @contextlib.contextmanager diff --git a/poleno/utils/tests/skip_test_models.py b/poleno/utils/tests/test_models.py similarity index 99% rename from poleno/utils/tests/skip_test_models.py rename to poleno/utils/tests/test_models.py index 082e96592..3f9ddb9db 100644 --- a/poleno/utils/tests/skip_test_models.py +++ b/poleno/utils/tests/test_models.py @@ -1,6 +1,7 @@ # vim: expandtab # -*- coding: utf-8 -*- import gc +import unittest from django.db import models from django.db.models.signals import post_save @@ -263,6 +264,7 @@ def test_empty_choices(self): with self.assertRaises(AttributeError): res.FIRST + @unittest.skip(u'FIXME') def test_duplicate_keys_raise_error(self): with self.assertRaisesMessage(ValueError, u'Duplicate choice key: 2'): FieldChoices((u'FIRST', 1, u'First'), (u'SECOND', 2, u'Second'), (u'THIRD', 2, u'Third')) diff --git a/poleno/utils/tests/skip_test_test.py b/poleno/utils/tests/test_test.py similarity index 100% rename from poleno/utils/tests/skip_test_test.py rename to poleno/utils/tests/test_test.py