Created
February 18, 2017 18:51
-
-
Save harshvb7/fb06dc067d7048176a5fb671306233b7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import pytest | |
| from example.models import Product | |
| pytestmark = pytest.mark.django_db | |
| class TestProductModel: | |
| def test_save(): | |
| product = Product.objects.create( | |
| name="Sample product", | |
| price=500 | |
| ) | |
| assert product.name == Sample product | |
| assert product.price == 500 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment