Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Lang field read only #894

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

M123-dev
Copy link
Member

What

Related to: openfoodfacts/smooth-app#4771 (comment)

Start lang: OpenFoodFactsLanguage.FRENCH

End lang: OpenFoodFactsLanguage.FRENCH

00:18 +0 -1: OpenFoodAPIClient Save product main language Save product main language [E]

  Expected: OpenFoodFactsLanguage:<OpenFoodFactsLanguage.GERMAN>
    Actual: OpenFoodFactsLanguage:<OpenFoodFactsLanguage.FRENCH>

00:18 +0 -1: Some tests failed.

It looks like we have a good old read only field

@monsieurtanuki
Copy link
Contributor

@M123-dev Thank you for your test!

That said:

  • it's MUCH better if you save data and get data from the same server, consistency-wise
      ProductResultV3 result = await OpenFoodAPIClient.getProductV3(
        ProductQueryConfiguration(
          barcode_1,
          version: ProductQueryVersion.v3,
        ),
        uriHelper: uriHelper, // was missing in your code
      );
  • it's also a good practice to check return codes, e.g. for the saveProduct call
  • that said, you're right!
  • And wrong. For "your" barcode (3017620425035) and the first barcode I tried (3350031897306) the language didn't change and cause a test failure. But for another one (8027498025058) the test passed.

@stephanegigandet I already experienced some madness tests with fields that couldn't be changed for some products. I guess some fields are locked on some products, like "the producer says this is the right value and it's irrelevant to change it". Is there a way we can detect which fields are locked for which products?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants