Ejemplo n.º 1
0
    def test_suggestion_when_name_provided(self):
        Name.objects.create(user=self.user,
                            given_name="First name",
                            family_name="Last name")
        suggestions = Name.get_suggestion(self.user)

        self.assertEqual(len(suggestions), 0)
Ejemplo n.º 2
0
    def test_suggestion_when_name_provided(self):
        Name.objects.create(user=self.user,
                            given_name="First name",
                            family_name="Last name")
        suggestions = Name.get_suggestion(self.user)

        self.assertEqual(len(suggestions), 0)
Ejemplo n.º 3
0
    def test_suggestion_when_name_blank(self):
        suggestions = Name.get_suggestion(self.user)

        self.assertEqual(len(suggestions), 1)
        suggestion = suggestions[0]
        self.assertEqual(suggestion['msg'], "Please add your name.")
        self.assertEqual(suggestion['priority'], 5)
Ejemplo n.º 4
0
    def test_suggestion_when_name_blank(self):
        suggestions = Name.get_suggestion(self.user)

        self.assertEqual(len(suggestions), 1)
        suggestion = suggestions[0]
        self.assertEqual(suggestion['msg'], "Please add your name.")
        self.assertEqual(suggestion['priority'], 5)