Esempio n. 1
0
    def test_dissociate_secondary_user_line(self):
        main_user_line = self.add_user_line_with_exten()
        secondary_user_line = self.prepare_secondary_user_line(main_user_line)

        user_line_dao.dissociate(secondary_user_line)

        self.assert_main_user_line_associated(main_user_line)
        self.assert_secondary_user_line_deleted(secondary_user_line)
Esempio n. 2
0
    def test_dissociate_secondary_user_line(self):
        main_user_line = self.add_user_line_with_exten()
        secondary_user_line = self.prepare_secondary_user_line(main_user_line)

        user_line_dao.dissociate(secondary_user_line)

        self.assert_main_user_line_associated(main_user_line)
        self.assert_secondary_user_line_deleted(secondary_user_line)
Esempio n. 3
0
    def test_dissociate_main_user_line_with_exten(self):
        user_line = self.add_user_line_with_exten()

        user_line_dao.dissociate(user_line)

        result = (self.session.query(UserLineSchema).filter(
            UserLineSchema.id == user_line.id).first())

        assert_that(result.user_id, none())
Esempio n. 4
0
    def test_dissociate_main_user_line_with_exten(self):
        user_line = self.add_user_line_with_exten()

        user_line_dao.dissociate(user_line)

        result = (self.session.query(UserLineSchema)
                  .filter(UserLineSchema.id == user_line.id)
                  .first())

        assert_that(result.user_id, none())
Esempio n. 5
0
def dissociate_user_line(user_line):
    user_line_dao.dissociate(user_line)
    if user_line.main_user:
        fix_main_user_dissociation(user_line.line_id)
Esempio n. 6
0
def dissociate_user_line(user_line):
    user_line_dao.dissociate(user_line)
    if user_line.main_user:
        fix_main_user_dissociation(user_line.line_id)