Repository: saleor/saleor

Issue:
Problem with filtering products
### What I'm trying to achieve
I want to filter out products from grocerries category but I receive results even when I should not.

### Steps to reproduce the problem
In groceries category there are two beers that have `abv` attribute with values: 51(5,1% alc) and 67(6,75 alc) but when filter with `abv` value set to 52 we receive `Carrot juice` 

Correct query:
```
query{	
  products(first: 100, attributes: ["abv:51"]){
  	edges {
      node {
        id
        name
      }
    }
  }
}
```
and correct result:
```
{
  "data": {
    "products": {
      "edges": [
        {
          "node": {
            "id": "UHJvZHVjdDo4Mw==",
            "name": "Seaman Lager"
          }
        }
      ]
    }
  }
}
```

Query with invalid value(abv set to 52):
```
query{	
  products(first: 100, attributes: ["abv:52"]){
  	edges {
      node {
        id
        name
      }
    }
  }
}
```
invalid result:
```
{
  "data": {
    "products": {
      "edges": [
        {
          "node": {
            "id": "UHJvZHVjdDo3Mw==",
            "name": "Carrot Juice"
          }
        }
      ]
    }
  }
}
```

### What I expected to happen
We should receive empty product list if passing abv value 52.


Discussion:
Most likely:
https://github.com/mirumee/saleor/blob/749b4e43ee9994d4c124fdf757b65f8f1cfd1b64/saleor/product/filters.py#L30-L40

Resolving patch:
diff --git a/saleor/graphql/product/filters.py b/saleor/graphql/product/filters.py
--- a/saleor/graphql/product/filters.py
+++ b/saleor/graphql/product/filters.py
@@ -51,7 +51,7 @@ def _clean_product_attributes_filter_input(filter_value) -> T_PRODUCT_FILTER_QUE
         if attr_name not in attributes_map:
             raise ValueError("Unknown attribute name: %r" % (attr_name,))
         attr_pk = attributes_map[attr_name]
-        attr_val_pk = values_map[attr_name].get(val_slug, val_slug)
+        attr_val_pk = values_map[attr_name].get(val_slug)
         queries[attr_pk].append(attr_val_pk)
 
     return queries


Test patch:
diff --git a/tests/api/test_product.py b/tests/api/test_product.py
--- a/tests/api/test_product.py
+++ b/tests/api/test_product.py
@@ -568,6 +568,33 @@ def test_filter_products_by_attributes(user_api_client, product):
     assert products[0]["node"]["name"] == product.name
 
 
+def test_filter_products_by_wrong_attributes(user_api_client, product):
+    product_attr = product.product_type.product_attributes.get(slug="color")
+    attr_value = (
+        product.product_type.variant_attributes.get(slug="size").values.first().id
+    )
+    filter_by = "%s:%s" % (product_attr.slug, attr_value)
+    query = """
+    query {
+        products(attributes: ["%(filter_by)s"], first: 1) {
+            edges {
+                node {
+                    name
+                }
+            }
+        }
+    }
+    """ % {
+        "filter_by": filter_by
+    }
+
+    response = user_api_client.post_graphql(query)
+    content = get_graphql_content(response)
+    products = content["data"]["products"]["edges"]
+
+    assert products == []
+
+
 def test_filter_products_by_categories(user_api_client, categories_tree, product):
     category = categories_tree.children.first()
     product.category = category