-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #513 from maykinmedia/feature/1155-link-from-map-t…
…o-location-view [#1155] Link from map to location view
- Loading branch information
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,7 @@ def test_get_geojson_feature(self): | |
"address_line_2": "1015CJ Amsterdam", | ||
"email": "[email protected]", | ||
"phonenumber": "+31666767676", | ||
"location_url": product_location.get_absolute_url(), | ||
}, | ||
} | ||
), | ||
|
@@ -170,6 +171,7 @@ def test_queryset_get_geojson_feature_collection(self): | |
"address_line_2": "7411KT Deventer", | ||
"email": "[email protected]", | ||
"phonenumber": "+31999767676", | ||
"location_url": product_location_1.get_absolute_url(), | ||
}, | ||
}, | ||
{ | ||
|
@@ -184,6 +186,7 @@ def test_queryset_get_geojson_feature_collection(self): | |
"address_line_2": "1015KL Amsterdam", | ||
"email": "[email protected]", | ||
"phonenumber": "+31666767676", | ||
"location_url": product_location_2.get_absolute_url(), | ||
}, | ||
}, | ||
], | ||
|
@@ -269,3 +272,31 @@ def test_shown_products_in_location_detail(self): | |
|
||
# check the draft product is not shown | ||
self.assertEqual(products.get(), published_product) | ||
|
||
|
||
class TestLocationViewThroughMap(WebTest): | ||
def test_product_location_link_is_rendered_on_home_page(self): | ||
product = ProductFactory() | ||
product_location = ProductLocationFactory() | ||
product.locations.add(product_location) | ||
|
||
response = self.app.get(reverse("root")) | ||
|
||
self.assertContains( | ||
response, | ||
reverse("pdc:location_detail", kwargs={"uuid": product_location.uuid}), | ||
) | ||
|
||
def test_product_location_link_is_rendered_on_product_page(self): | ||
product = ProductFactory() | ||
product_location = ProductLocationFactory() | ||
product.locations.add(product_location) | ||
|
||
response = self.app.get( | ||
reverse("pdc:product_detail", kwargs={"slug": product.slug}) | ||
) | ||
|
||
self.assertContains( | ||
response, | ||
reverse("pdc:location_detail", kwargs={"uuid": product_location.uuid}), | ||
) |