def test_suggestion_when_phone_entered(self): phone = Telephone(user=self.user) phone.use_code = 'mobile' phone.save() # Get the actual results actual = Telephone.get_suggestion(self.user) self.assertEqual(actual, [])
def test_suggestion_when_phone_blank(self): expected = [{'msg': 'Would you like to add a telephone?', 'priority': 5, 'module': 'Telephone', 'url': reverse('handle_form') + '?module=Telephone&id=new' }] actual = Telephone.get_suggestion(self.user) # Sort lists to ensure identical order self.assertEqual(actual, expected)
def test_suggestion_when_phone_blank(self): expected = [{ 'msg': 'Would you like to add a telephone?', 'priority': 5, 'module': 'Telephone', 'url': reverse('handle_form') + '?module=Telephone&id=new' }] actual = Telephone.get_suggestion(self.user) # Sort lists to ensure identical order self.assertEqual(actual, expected)
def test_suggestion_when_phone_blank(self): expected = [ { "msg": "Would you like to add a telephone?", "priority": 5, "module": "Telephone", "url": reverse("handle_form") + "?module=Telephone&id=new", } ] actual = Telephone.get_suggestion(self.user) # Sort lists to ensure identical order self.assertEqual(actual, expected)