def test_embed_url(db_conn, cards_table): """ Expect embed card to require URL. """ card, errors = EmbedCard.insert(db_conn, { 'unit_id': 'RUF531', 'name': 'What is?', 'rubric': True, # TODO }) assert len(errors) == 1 card, errors = card.update(db_conn, {'url': 'http://google.com'}) assert len(errors) == 0
def test_embed_url(cards_table): """ Expect embed card to require URL. """ card, errors = EmbedCard.insert({ 'unit_id': 'RUF531', 'name': 'What is?', 'rubric': True, # TODO }) assert len(errors) == 1 card, errors = card.update({'url': 'http://google.com'}) assert len(errors) == 0
def test_embed_rubric(db_conn, cards_table): """ Expect embed card to require a rubric. """ card, errors = EmbedCard.insert(db_conn, { 'unit_id': 'RUF531', 'name': 'What is?', 'url': 'http://google.com', }) assert len(errors) == 1 card, errors = card.update(db_conn, {'rubric': None}) assert len(errors) == 0
def test_embed_rubric(cards_table): """ Expect embed card to require a rubric. """ card, errors = EmbedCard.insert({ 'unit_id': 'RUF531', 'name': 'What is?', 'url': 'http://google.com', }) assert len(errors) == 1 card, errors = card.update({'rubric': None}) assert len(errors) == 0