Unfortunately, python doesn't have good built-in support for formatting dates in locales other than the current one. You can temporarily switch locales, but that's not a great solution.
You can use the the Babel package to format the dates, though it doesn't provide precisely the same value you expect -- the case is slightly different.
For example, you could create a keyword that dates a month, year, and locale, and returns the formatted version.
First, create a python file named CustomKeywords.py
with the following contents:
# CustomKeywords.py
import datetime
from babel.dates import format_date
class CustomKeywords:
def get_date_for_locale(self, locale, year, month=1, day=1):
d = datetime.date(int(year), int(month), int(day))
return format_date(d, "MMMM Y", locale=locale)
Next, import this library into your test case and then call get date for locale
to get the date for a given locale:
*** Settings ***
Library CustomKeywords.py
*** Test Case ***
Vietnamese
${date}= get date for locale vi_VN 2017 7
Should be equal ${date} tháng bảy 2017
Thailand
${date}= get date for locale th_TH 2017 7
Should be equal ${date} กรกฎาคม 2017