Skip to Content
Mar 28, 2017 at 07:25 PM

How do I ensure that the session language is being used in unit tests of HANA calculation views?

561 Views Last edit Jun 24, 2021 at 12:51 PM 3 rev


We have .xsodata services based on calculation views modelled in HANA. We are also running unit tests on the calculation views.

We recently changed from having the views accept the language via incoming parameters to taking the users session language from the Accept-Language header and filtering based on that value ($$language$$).

After making that change our unit tests began failing because the language is not being set or can't be seen by the unit test application. This causes the select from the temp calculation view to return "undefined" values, or basically nothing.

How do I access or assign the language to the test program's session? I tried setting it with "var application_language = $.session.language = 'en';" but I get an error telling me I can't set a value that only has a getter...

I verified that I have a language assigned to my user profile however I am wondering in multilingual situations, such as mine, how would one test that the value is being returned correctly in more than one language? This is why I thought I should be able to set the language in the test script.

Any advice or direction would be greatly appreciated.