Merge Request #64

Merged
softwarepublico/colab!64
Created by Gustavo Jaruga Cruz

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.

Assignee: None
Milestone: None

Merged by Sergio Oliveira

Source branch has been removed
Commits (1)
2 participants
colab/accounts/tests/test_user.py
@@ -2,7 +2,10 @@ @@ -2,7 +2,10 @@
2 Test User class. 2 Test User class.
3 Objective: Test parameters, and behavior. 3 Objective: Test parameters, and behavior.
4 """ 4 """
  5 +import mock
  6 +
5 from colab.accounts.models import User 7 from colab.accounts.models import User
  8 +from colab.accounts import forms as accounts_forms
6 from django.test import TestCase, Client 9 from django.test import TestCase, Client
7 10
8 11
@@ -11,6 +14,7 @@ class UserTest(TestCase): @@ -11,6 +14,7 @@ class UserTest(TestCase):
11 def setUp(self): 14 def setUp(self):
12 self.user = self.create_user() 15 self.user = self.create_user()
13 self.client = Client() 16 self.client = Client()
  17 + accounts_forms.validate_social_account = mock.Mock(return_value=True)
14 18
15 def tearDown(self): 19 def tearDown(self):
16 pass 20 pass