For our trip to Beijing last year, we wore nothing but shorts during our entire stay. Although most days were in the 80's, we visited most of the primary tourist sites without any problems with our dress.
Dinner was had in a variety of restaurants, from casual diners to slightly more upscale establishments, all while wearing shorts.
Unlike Mexico City or Seychelles, where shorts are frowned upon, the latter for dinner, Beijing proved to be tolerant.