Exemplo n.º 1
0
    def test_given_main_user_then_dissociation_gets_fixed(
            self, user_line_dissociate, fix_main_user_dissociation):
        user_line = Mock(UserLine, line_id=1, main_user=True)

        ule_service.dissociate_user_line(user_line)

        user_line_dissociate.assert_called_once_with(user_line)
        fix_main_user_dissociation.assert_called_once_with(user_line.line_id)
Exemplo n.º 2
0
    def test_given_secondary_user_then_only_user_line_dissociated(
            self, user_line_dissociate, fix_main_user_dissociation):
        user_line = Mock(UserLine, line_id=1, main_user=False)

        ule_service.dissociate_user_line(user_line)

        user_line_dissociate.assert_called_once_with(user_line)
        self.assertNotCalled(fix_main_user_dissociation)
Exemplo n.º 3
0
    def test_given_main_user_then_dissociation_gets_fixed(self,
                                                          user_line_dissociate,
                                                          fix_main_user_dissociation):
        user_line = Mock(UserLine, line_id=1, main_user=True)

        ule_service.dissociate_user_line(user_line)

        user_line_dissociate.assert_called_once_with(user_line)
        fix_main_user_dissociation.assert_called_once_with(user_line.line_id)
Exemplo n.º 4
0
    def test_given_secondary_user_then_only_user_line_dissociated(self,
                                                                  user_line_dissociate,
                                                                  fix_main_user_dissociation):
        user_line = Mock(UserLine, line_id=1, main_user=False)

        ule_service.dissociate_user_line(user_line)

        user_line_dissociate.assert_called_once_with(user_line)
        self.assertNotCalled(fix_main_user_dissociation)
Exemplo n.º 5
0
def dissociate(user_line):
    validator.validate_dissociation(user_line)
    ule_service.dissociate_user_line(user_line)
    notifier.dissociated(user_line)
Exemplo n.º 6
0
def dissociate(user_line):
    validator.validate_dissociation(user_line)
    ule_service.dissociate_user_line(user_line)
    notifier.dissociated(user_line)