Exemplo n.º 1
0
    def setUp(self):
        """Creates a user and adds likes to their account."""
        make_products()
        create_user()
        product_1 = Product.objects.earliest('date_added')
        product_2 = Product.objects.latest('date_added')
        make_policies()

        test_user = get_user_model().objects.latest('date_joined')
        test_user.userprofile.liked_products.add(*[product_1.id, product_2.id])
Exemplo n.º 2
0
    def setUp(self):
        create_user()
        make_policies()

        test_user = get_user_model().objects.latest('date_joined')
        self.client.force_login(test_user)
        self.client.post(
            reverse('cookies:consent'
                    ), {'cookie-consent': 'opt-in'},
            HTTP_X_REQUESTED_WITH='XMLHttpRequest')
Exemplo n.º 3
0
 def setUp(self):
     create_user()
     make_policies()
Exemplo n.º 4
0
def test_user(db):
    user = sample_user()
    return create_user(**user)