예제 #1
0
    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, [])
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
    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)
예제 #5
0
    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, [])