Example #1
0
 def test_has_reference_to_user_id(self) -> None:
     feedback_models.UnsentFeedbackEmailModel(id='user_id').put()
     self.assertTrue(
         feedback_models.UnsentFeedbackEmailModel.has_reference_to_user_id(
             'user_id'))
     self.assertFalse(
         feedback_models.UnsentFeedbackEmailModel.has_reference_to_user_id(
             'id_x'))
Example #2
0
    def test_new_instances_stores_correct_data(self) -> None:
        user_id = 'A'
        message_reference_dict = {
            'exploration_id': 'ABC123',
            'thread_id': 'thread_id1',
            'message_id': 'message_id1'
        }
        email_instance = feedback_models.UnsentFeedbackEmailModel(
            id=user_id, feedback_message_references=[message_reference_dict])
        email_instance.update_timestamps()
        email_instance.put()

        retrieved_instance = (
            feedback_models.UnsentFeedbackEmailModel.get_by_id(id=user_id))

        self.assertEqual(retrieved_instance.feedback_message_references,
                         [message_reference_dict])
        self.assertEqual(retrieved_instance.retries, 0)
Example #3
0
 def setUp(self) -> None:
     super().setUp()
     feedback_models.UnsentFeedbackEmailModel(id='user_id').put()