def test_contact_tracing(self):
     self.login_test_authority()
     from tests.models.test_customer import TestCustomer
     from gooutsafe.dao.customer_manager import CustomerManager
     customer, _ = TestCustomer.generate_random_customer()
     CustomerManager.create_customer(customer=customer)
     rv = self.client.get('ha/contact/' + str(customer.id),
                          follow_redirects=True)
     self.assertEqual(rv.status_code, 200)
def load_random_customer(n: int):
    from gooutsafe.dao.customer_manager import CustomerManager
    from tests.models.test_customer import TestCustomer

    for _ in range(0, n):
        customer, _ = TestCustomer.generate_random_customer()
        CustomerManager.create_customer(customer=customer)

    print('Random users added to db')
 def test_mark_positive_authorized_inex(self):
     authority = self.login_test_authority()
     from tests.models.test_customer import TestCustomer
     from gooutsafe.dao.customer_manager import CustomerManager
     customer, _ = TestCustomer.generate_random_customer()
     customer.set_health_status(True)
     CustomerManager.create_customer(customer=customer)
     rv = self.client.post('ha/mark_positive/' + str(customer.id),
                           follow_redirects=True)
     self.assertEqual(rv.status_code, 200)
    def test_search_customer_with_ssn(self):
        from tests.models.test_customer import TestCustomer
        from gooutsafe.dao.customer_manager import CustomerManager

        customer, (_, _, _, _, _, ssn, _,
                   _) = TestCustomer.generate_random_customer()
        CustomerManager.create_customer(customer=customer)

        self.login_test_authority()
        rv = self.client.post('/ha/search_customer',
                              data=dict(track_type='SSN', customer_ident=ssn),
                              follow_redirects=True)

        self.assertEqual(rv.status_code, 200)
Beispiel #5
0
    def test_create_delete(self):
        restaurant, _ = TestRestaurant.generate_random_restaurant()
        customer, _ = TestCustomer.generate_random_customer()

        from gooutsafe.dao.customer_manager import CustomerManager
        from gooutsafe.dao.restaurant_manager import RestaurantManager

        # Adding restaurant
        RestaurantManager.create_restaurant(restaurant=restaurant)
        # Adding user
        CustomerManager.create_customer(customer=customer)

        self.like_manager.LikeManager.create_like(customer.id, restaurant.id)
        self.like_manager.LikeManager.delete_like(customer.id, restaurant.id)

        self.assertEqual(
            False,
            self.like_manager.LikeManager.like_exists(
                restaurant_id=restaurant.id, user_id=customer.id))