cancel
Showing results for 
Search instead for 
Did you mean: 

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

david_bussiere
Explorer
0 Kudos

Hello,

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.

JimSpath
Active Contributor
0 Kudos

I noticed this topic recently and answers may be moot now, but for others who may have the same question I wrote about the topic on this post:

Answer-Thon 2021: A Question For Today July 13th

Accepted Solutions (0)

Answers (0)