Esempio n. 1
0
    def test_invalid_relatedname(self):
        relationship = Relationship(self.active_client,
                                    self.patrimony,
                                    related_name='invalid')

        # pylint: disable=protected-access
        with self.assertRaisesMessage(
                AttributeError, "'invalid' is not a valid related_name"
                " for 'ActiveClient' nor for"
                " 'Patrimony'."):
            relationship._check_relatedname()
Esempio n. 2
0
 def test_check_relatedname_swapped(self):
     relationship = Relationship(self.financial_planning,
                                 self.active_client,
                                 related_name='financial_planning')
     # pylint: disable=protected-access
     relationship._check_relatedname()  # Fail if Error