Merge Request #64
← To merge requests
From
fix_social_tests
into
master
Fix social tests
Profile Social fields tests used a validator that accesses an external site to check for its existence, aka: if a given facebook username existed or not. Added a mock to this validator to fix the broken tests and focus only on the fields validators like max length instead.
Commits (1)
-
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com>
Showing
1 changed file
Show diff stats
colab/accounts/tests/test_user.py
... | ... | @@ -2,7 +2,10 @@ |
2 | 2 | Test User class. |
3 | 3 | Objective: Test parameters, and behavior. |
4 | 4 | """ |
5 | +import mock | |
6 | + | |
5 | 7 | from colab.accounts.models import User |
8 | +from colab.accounts import forms as accounts_forms | |
6 | 9 | from django.test import TestCase, Client |
7 | 10 | |
8 | 11 | |
... | ... | @@ -11,6 +14,7 @@ class UserTest(TestCase): |
11 | 14 | def setUp(self): |
12 | 15 | self.user = self.create_user() |
13 | 16 | self.client = Client() |
17 | + accounts_forms.validate_social_account = mock.Mock(return_value=True) | |
14 | 18 | |
15 | 19 | def tearDown(self): |
16 | 20 | pass | ... | ... |
-
mentioned in commit 96079971213be209137fce16bb740f5f9b5d3260