Ejemplo n.º 1
0
    def test_can_two_user_details_be_saved_to_the_database__Should_save_the_two_user_details_to_database(
            self):
        """Test whether the database can _save two user data"""

        user_data = _update_data(_get_test_data(),
                                 field_to_update='first_name',
                                 new_data='Egbie1')
        Database.insert_one(user_data, _DB_NAME)

        query_data1 = Database.find_one({'first_name': 'Egbie'},
                                        db_name=_DB_NAME)
        query_data2 = Database.find_one({'first_name': 'Egbie1'},
                                        db_name=_DB_NAME)

        self.assertIsNotNone(query_data1,
                             msg='The data for user1 was not returned')
        self.assertIsNotNone(query_data2,
                             msg='The data for user2 was not returned')
Ejemplo n.º 2
0
 def setUpClass(cls):
     """Initialise the entire Database class by creating a test fissure"""
     Database.db_init(_DB_NAME)
     Database.insert_one(_get_test_data(), _DB_NAME)